summaryrefslogtreecommitdiffstats
path: root/src/command_line_options.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'src/command_line_options.cpp')
-rw-r--r--src/command_line_options.cpp66
1 files changed, 35 insertions, 31 deletions
diff --git a/src/command_line_options.cpp b/src/command_line_options.cpp
index bd085fc..4f1b4f6 100644
--- a/src/command_line_options.cpp
+++ b/src/command_line_options.cpp
@@ -4,38 +4,39 @@
CommandLineOptions::CommandLineOptions(int argc, char * const argv[]) {
// parse command line arguments (please sort by short option for easier handling)
- static const struct option longOptions[] = {
- {"base", required_argument, NULL, 'b'},
- {"path", required_argument, NULL, 'b'}, // Compatibility to v1.0
- {"config", required_argument, NULL, 'c'},
- {"debug", no_argument, NULL, 'D'},
- {"default", required_argument, NULL, 'd'},
- {"fullscreen", no_argument, NULL, 'F'},
- {"file", required_argument, NULL, 'f'},
- {"help", no_argument, NULL, 'h'},
- {"locations", required_argument, NULL, 'l'},
- {"pool", required_argument, NULL, 'P'},
- {"pvs", no_argument, NULL, 'p'},
- {"runscript", no_argument, NULL, 'S'},
- {"size", required_argument, NULL, 's'},
- {"tab", required_argument, NULL, 'T'},
- {"theme", required_argument, NULL, 't'},
- {"url", required_argument, NULL, 'u'},
- {"version", no_argument, NULL, 'v'},
- {"xpath", required_argument, NULL, 'x'},
- {"location-mode", required_argument, NULL, 'locm'},
- {"template-mode", required_argument, NULL, 'tmpm'},
- {0, 0, 0, 0}
- };
+ static const struct option longOptions[] = {
+ {"base", required_argument, NULL, 'b'},
+ {"path", required_argument, NULL, 'b'}, // Compatibility to v1.0
+ {"config", required_argument, NULL, 'c'},
+ {"debug", no_argument, NULL, 'D'},
+ {"default", required_argument, NULL, 'd'},
+ {"fullscreen", no_argument, NULL, 'F'},
+ {"file", required_argument, NULL, 'f'},
+ {"help", no_argument, NULL, 'h'},
+ {"locations", required_argument, NULL, 'l'},
+ {"pool", required_argument, NULL, 'P'},
+ {"pvs", no_argument, NULL, 'p'},
+ {"runscript", no_argument, NULL, 'S'},
+ {"size", required_argument, NULL, 's'},
+ {"tab", required_argument, NULL, 'T'},
+ {"theme", required_argument, NULL, 't'},
+ {"url", required_argument, NULL, 'u'},
+ {"version", no_argument, NULL, 'v'},
+ {"xpath", required_argument, NULL, 'x'},
+ {"location-mode", required_argument, NULL, 'locm'},
+ {"template-mode", required_argument, NULL, 'tmpm'},
+ {"no-vtx", no_argument, NULL, 'nvtx'},
+ {0, 0, 0, 0}
+ };
- int c;
+ int c;
- // Again, please sort alphabetically in getopt_long call and switch statement
+ // Again, please sort alphabetically in getopt_long call and switch statement
while ((c = getopt_long(argc, argv, "b:c:Dd:Ff:hl:P:pSs:t:T:u:vx:?", longOptions, NULL)) != -1) {
switch (c) {
case 'b':
- options.insert("base", optarg);
- break;
+ options.insert("base", optarg);
+ break;
case 'c':
options.insert("config", optarg);
break;
@@ -65,8 +66,8 @@ CommandLineOptions::CommandLineOptions(int argc, char * const argv[]) {
options.insert("pool", optarg);
break;
case 'S':
- options.insert("runscript", optarg);
- break;
+ options.insert("runscript", optarg);
+ break;
case 's':
options.insert("size", optarg);
break;
@@ -77,8 +78,8 @@ CommandLineOptions::CommandLineOptions(int argc, char * const argv[]) {
options.insert("tab", optarg);
break;
case 'u':
- options.insert("url", optarg);
- break;
+ options.insert("url", optarg);
+ break;
case 'v':
options.insert("version", "version");
break;
@@ -91,6 +92,9 @@ CommandLineOptions::CommandLineOptions(int argc, char * const argv[]) {
case 'tmpm':
options.insert("template-mode", optarg);
break;
+ case 'nvtx':
+ options.insert("no-vtx", "no-vtx");
+ break;
default:
options.insert("error", "error");
break;