diff options
Diffstat (limited to 'akonadish/syntax_modules/core_syntax.cpp')
-rw-r--r-- | akonadish/syntax_modules/core_syntax.cpp | 49 |
1 files changed, 25 insertions, 24 deletions
diff --git a/akonadish/syntax_modules/core_syntax.cpp b/akonadish/syntax_modules/core_syntax.cpp index 8fb1448..a0cd4c6 100644 --- a/akonadish/syntax_modules/core_syntax.cpp +++ b/akonadish/syntax_modules/core_syntax.cpp | |||
@@ -17,37 +17,16 @@ | |||
17 | * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. | 17 | * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. |
18 | */ | 18 | */ |
19 | 19 | ||
20 | #include "core_syntax.h" | ||
21 | |||
22 | #include <QDebug> | 20 | #include <QDebug> |
23 | #include <QObject> // tr() | 21 | #include <QObject> // tr() |
24 | #include <QSet> | 22 | #include <QSet> |
25 | #include <QTextStream> | 23 | #include <QTextStream> |
26 | 24 | ||
27 | namespace CoreSyntax | 25 | #include "state.h" |
28 | { | 26 | #include "syntaxtree.h" |
29 | |||
30 | REGISTER_SYNTAX(CoreSyntax) | ||
31 | 27 | ||
32 | Syntax::List syntax() | 28 | namespace CoreSyntax |
33 | { | 29 | { |
34 | Syntax::List syntax; | ||
35 | syntax << Syntax("exit", QObject::tr("Exits the application. Ctrl-d also works!"), &CoreSyntax::exit); | ||
36 | |||
37 | Syntax help(QObject::tr("help"), QObject::tr("Print command information: help [command]"), &CoreSyntax::showHelp); | ||
38 | help.completer = &CoreSyntax::showHelpCompleter; | ||
39 | syntax << help; | ||
40 | |||
41 | Syntax set(QObject::tr("set"), QObject::tr("Sets settings for the session")); | ||
42 | set.children << Syntax(QObject::tr("debug"), QObject::tr("Set the debug level from 0 to 6"), &CoreSyntax::setDebugLevel); | ||
43 | syntax << set; | ||
44 | |||
45 | Syntax get(QObject::tr("get"), QObject::tr("Gets settings for the session")); | ||
46 | get.children << Syntax(QObject::tr("debug"), QObject::tr("Set the debug level from 0 to 6"), &CoreSyntax::printDebugLevel); | ||
47 | syntax << get; | ||
48 | |||
49 | return syntax; | ||
50 | } | ||
51 | 30 | ||
52 | bool exit(const QStringList &, State &) | 31 | bool exit(const QStringList &, State &) |
53 | { | 32 | { |
@@ -137,5 +116,27 @@ bool printDebugLevel(const QStringList &commands, State &state) | |||
137 | return true; | 116 | return true; |
138 | } | 117 | } |
139 | 118 | ||
119 | Syntax::List syntax() | ||
120 | { | ||
121 | Syntax::List syntax; | ||
122 | syntax << Syntax("exit", QObject::tr("Exits the application. Ctrl-d also works!"), &CoreSyntax::exit); | ||
123 | |||
124 | Syntax help(QObject::tr("help"), QObject::tr("Print command information: help [command]"), &CoreSyntax::showHelp); | ||
125 | help.completer = &CoreSyntax::showHelpCompleter; | ||
126 | syntax << help; | ||
127 | |||
128 | Syntax set(QObject::tr("set"), QObject::tr("Sets settings for the session")); | ||
129 | set.children << Syntax(QObject::tr("debug"), QObject::tr("Set the debug level from 0 to 6"), &CoreSyntax::setDebugLevel); | ||
130 | syntax << set; | ||
131 | |||
132 | Syntax get(QObject::tr("get"), QObject::tr("Gets settings for the session")); | ||
133 | get.children << Syntax(QObject::tr("debug"), QObject::tr("Set the debug level from 0 to 6"), &CoreSyntax::printDebugLevel); | ||
134 | syntax << get; | ||
135 | |||
136 | return syntax; | ||
137 | } | ||
138 | |||
139 | REGISTER_SYNTAX(CoreSyntax) | ||
140 | |||
140 | } // namespace CoreSyntax | 141 | } // namespace CoreSyntax |
141 | 142 | ||