diff options
Diffstat (limited to 'src')
-rw-r--r-- | src/FbTk/CommandParser.hh | 2 | ||||
-rw-r--r-- | src/main.cc | 10 |
2 files changed, 10 insertions, 2 deletions
diff --git a/src/FbTk/CommandParser.hh b/src/FbTk/CommandParser.hh index 45ce001..3e40ed6 100644 --- a/src/FbTk/CommandParser.hh +++ b/src/FbTk/CommandParser.hh | |||
@@ -128,7 +128,7 @@ public: | |||
128 | return it->second; | 128 | return it->second; |
129 | } | 129 | } |
130 | 130 | ||
131 | const CreatorMap creatorMap() const { return m_creators; } | 131 | const CreatorMap &creatorMap() const { return m_creators; } |
132 | 132 | ||
133 | private: | 133 | private: |
134 | CommandParser() {} | 134 | CommandParser() {} |
diff --git a/src/main.cc b/src/main.cc index 9da51ec..bc43a93 100644 --- a/src/main.cc +++ b/src/main.cc | |||
@@ -26,7 +26,7 @@ | |||
26 | 26 | ||
27 | #include "FbTk/Theme.hh" | 27 | #include "FbTk/Theme.hh" |
28 | #include "FbTk/I18n.hh" | 28 | #include "FbTk/I18n.hh" |
29 | #include "FbTk/StringUtil.hh" | 29 | #include "FbTk/CommandParser.hh" |
30 | 30 | ||
31 | #ifdef HAVE_CONFIG_H | 31 | #ifdef HAVE_CONFIG_H |
32 | #include "config.h" | 32 | #include "config.h" |
@@ -239,6 +239,7 @@ int main(int argc, char **argv) { | |||
239 | "-rc <string>\t\t\tuse alternate resource file.\n" | 239 | "-rc <string>\t\t\tuse alternate resource file.\n" |
240 | "-version\t\t\tdisplay version and exit.\n" | 240 | "-version\t\t\tdisplay version and exit.\n" |
241 | "-info\t\t\t\tdisplay some useful information.\n" | 241 | "-info\t\t\t\tdisplay some useful information.\n" |
242 | "-list-commands\t\t\tlist all valid key commands.\n" | ||
242 | "-log <filename>\t\t\tlog output to file.\n" | 243 | "-log <filename>\t\t\tlog output to file.\n" |
243 | "-help\t\t\t\tdisplay this help text and exit.\n\n", | 244 | "-help\t\t\t\tdisplay this help text and exit.\n\n", |
244 | 245 | ||
@@ -248,6 +249,13 @@ int main(int argc, char **argv) { | |||
248 | } else if (arg == "-info" || arg == "-i") { | 249 | } else if (arg == "-info" || arg == "-i") { |
249 | showInfo(cout); | 250 | showInfo(cout); |
250 | exit(EXIT_SUCCESS); | 251 | exit(EXIT_SUCCESS); |
252 | } else if (arg == "-list-commands") { | ||
253 | FbTk::CommandParser<void>::CreatorMap cmap = FbTk::CommandParser<void>::instance().creatorMap(); | ||
254 | FbTk::CommandParser<void>::CreatorMap::const_iterator it = cmap.begin(); | ||
255 | const FbTk::CommandParser<void>::CreatorMap::const_iterator it_end = cmap.end(); | ||
256 | for (; it != it_end; ++it) | ||
257 | cout << it->first << endl; | ||
258 | exit(EXIT_SUCCESS); | ||
251 | } else if (arg == "-verbose") { | 259 | } else if (arg == "-verbose") { |
252 | FbTk::ThemeManager::instance().setVerbose(true); | 260 | FbTk::ThemeManager::instance().setVerbose(true); |
253 | } | 261 | } |