add new command line option -list-commands
This commit is contained in:
parent
bfaec62d79
commit
ad6a7e48f4
12 changed files with 1320 additions and 1112 deletions
|
@ -1,5 +1,9 @@
|
|||
(Format: Year/Month/Day)
|
||||
Changes for 1.1
|
||||
*08/06/03:
|
||||
* Add -list-commands command line option, which prints a list of valid
|
||||
fluxbox commands (Mark)
|
||||
main.cc
|
||||
*08/05/13:
|
||||
* Only reload custom menus when necessary (Mark)
|
||||
FbCommands.cc/hh
|
||||
|
|
File diff suppressed because it is too large
Load diff
|
@ -9,15 +9,17 @@ fluxbox - A lightweight window manager for the X Windowing System
|
|||
|
||||
SYNOPSIS
|
||||
--------
|
||||
'fluxbox' [-v | -version]
|
||||
[-h | -help]
|
||||
[-i | -info]
|
||||
'fluxbox' [-rc rcfile]
|
||||
[-log logfile]
|
||||
[-display display]
|
||||
[-screen scr,scr|all]
|
||||
[-verbose]
|
||||
|
||||
'fluxbox' [-v | -version] |
|
||||
[-h | -help] |
|
||||
[-i | -info] |
|
||||
[-list-commands]
|
||||
|
||||
DESCRIPTION
|
||||
-----------
|
||||
fluxbox(1) provides configurable window decorations, a root menu to launch
|
||||
|
|
|
@ -258,6 +258,7 @@ Website: http://www.fluxbox.org/\n\n\
|
|||
-rc <string>\t\t\tuse alternate resource file.\n\
|
||||
-version\t\t\tdisplay version and exit.\n\
|
||||
-info\t\t\t\tdisplay some useful information.\n\
|
||||
-list-commands\t\t\tlist all valid key commands.\n\
|
||||
-log <filename>\t\t\tlog output to file.\n\
|
||||
-help\t\t\t\tdisplay this help text and exit.\n\n
|
||||
14 warning: couldn't set environment variable 'DISPLAY'
|
||||
|
|
|
@ -258,6 +258,7 @@ Website: http://www.fluxbox.org/\n\n\
|
|||
-rc <string>\t\t\tuse alternate resource file.\n\
|
||||
-version\t\t\tdisplay version and exit.\n\
|
||||
-info\t\t\t\tdisplay some useful information.\n\
|
||||
-list-commands\t\t\tlist all valid key commands.\n\
|
||||
-log <filename>\t\t\tlog output to file.\n\
|
||||
-help\t\t\t\tdisplay this help text and exit.\n\n
|
||||
14 warning: couldn't set environment variable 'DISPLAY'
|
||||
|
|
|
@ -258,6 +258,7 @@ Website: http://www.fluxbox.org/\n\n\
|
|||
-rc <string>\t\t\tuse alternate resource file.\n\
|
||||
-version\t\t\tdisplay version and exit.\n\
|
||||
-info\t\t\t\tdisplay some useful information.\n\
|
||||
-list-commands\t\t\tlist all valid key commands.\n\
|
||||
-log <filename>\t\t\tlog output to file.\n\
|
||||
-help\t\t\t\tdisplay this help text and exit.\n\n
|
||||
14 warning: couldn't set environment variable 'DISPLAY'
|
||||
|
|
|
@ -258,6 +258,7 @@ Website: http://www.fluxbox.org/\n\n\
|
|||
-rc <string>\t\t\tuse alternate resource file.\n\
|
||||
-version\t\t\tdisplay version and exit.\n\
|
||||
-info\t\t\t\tdisplay some useful information.\n\
|
||||
-list-commands\t\t\tlist all valid key commands.\n\
|
||||
-log <filename>\t\t\tlog output to file.\n\
|
||||
-help\t\t\t\tdisplay this help text and exit.\n\n
|
||||
14 warning: couldn't set environment variable 'DISPLAY'
|
||||
|
|
|
@ -258,6 +258,7 @@ Website: http://www.fluxbox.org/\n\n\
|
|||
-rc <string>\t\t\tuse alternate resource file.\n\
|
||||
-version\t\t\tdisplay version and exit.\n\
|
||||
-info\t\t\t\tdisplay some useful information.\n\
|
||||
-list-commands\t\t\tlist all valid key commands.\n\
|
||||
-log <filename>\t\t\tlog output to file.\n\
|
||||
-help\t\t\t\tdisplay this help text and exit.\n\n
|
||||
14 warning: couldn't set environment variable 'DISPLAY'
|
||||
|
|
|
@ -258,6 +258,7 @@ Website: http://www.fluxbox.org/\n\n\
|
|||
-rc <string>\t\t\tuse alternate resource file.\n\
|
||||
-version\t\t\tdisplay version and exit.\n\
|
||||
-info\t\t\t\tdisplay some useful information.\n\
|
||||
-list-commands\t\t\tlist all valid key commands.\n\
|
||||
-log <filename>\t\t\tlog output to file.\n\
|
||||
-help\t\t\t\tdisplay this help text and exit.\n\n
|
||||
14 warning: couldn't set environment variable 'DISPLAY'
|
||||
|
|
|
@ -258,6 +258,7 @@ Website: http://www.fluxbox.org/\n\n\
|
|||
-rc <string>\t\t\tuse alternate resource file.\n\
|
||||
-version\t\t\tdisplay version and exit.\n\
|
||||
-info\t\t\t\tdisplay some useful information.\n\
|
||||
-list-commands\t\t\tlist all valid key commands.\n\
|
||||
-log <filename>\t\t\tlog output to file.\n\
|
||||
-help\t\t\t\tdisplay this help text and exit.\n\n
|
||||
14 warning: couldn't set environment variable 'DISPLAY'
|
||||
|
|
|
@ -128,7 +128,7 @@ public:
|
|||
return it->second;
|
||||
}
|
||||
|
||||
const CreatorMap creatorMap() const { return m_creators; }
|
||||
const CreatorMap &creatorMap() const { return m_creators; }
|
||||
|
||||
private:
|
||||
CommandParser() {}
|
||||
|
|
10
src/main.cc
10
src/main.cc
|
@ -26,7 +26,7 @@
|
|||
|
||||
#include "FbTk/Theme.hh"
|
||||
#include "FbTk/I18n.hh"
|
||||
#include "FbTk/StringUtil.hh"
|
||||
#include "FbTk/CommandParser.hh"
|
||||
|
||||
#ifdef HAVE_CONFIG_H
|
||||
#include "config.h"
|
||||
|
@ -239,6 +239,7 @@ int main(int argc, char **argv) {
|
|||
"-rc <string>\t\t\tuse alternate resource file.\n"
|
||||
"-version\t\t\tdisplay version and exit.\n"
|
||||
"-info\t\t\t\tdisplay some useful information.\n"
|
||||
"-list-commands\t\t\tlist all valid key commands.\n"
|
||||
"-log <filename>\t\t\tlog output to file.\n"
|
||||
"-help\t\t\t\tdisplay this help text and exit.\n\n",
|
||||
|
||||
|
@ -248,6 +249,13 @@ int main(int argc, char **argv) {
|
|||
} else if (arg == "-info" || arg == "-i") {
|
||||
showInfo(cout);
|
||||
exit(EXIT_SUCCESS);
|
||||
} else if (arg == "-list-commands") {
|
||||
FbTk::CommandParser<void>::CreatorMap cmap = FbTk::CommandParser<void>::instance().creatorMap();
|
||||
FbTk::CommandParser<void>::CreatorMap::const_iterator it = cmap.begin();
|
||||
const FbTk::CommandParser<void>::CreatorMap::const_iterator it_end = cmap.end();
|
||||
for (; it != it_end; ++it)
|
||||
cout << it->first << endl;
|
||||
exit(EXIT_SUCCESS);
|
||||
} else if (arg == "-verbose") {
|
||||
FbTk::ThemeManager::instance().setVerbose(true);
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue