diff options
author | Mark Tiefenbruck <mark@fluxbox.org> | 2008-10-04 21:32:20 (GMT) |
---|---|---|
committer | Mark Tiefenbruck <mark@fluxbox.org> | 2008-10-04 21:32:20 (GMT) |
commit | aee9889a27f97c8116fd4472cd3374b74e868bb6 (patch) | |
tree | 4762671c40b1570fb248ac9ff9cbf835845071f3 /util | |
parent | e6570b61f34e9d7822f500706a5a2cd6bc436234 (diff) | |
download | fluxbox-aee9889a27f97c8116fd4472cd3374b74e868bb6.zip fluxbox-aee9889a27f97c8116fd4472cd3374b74e868bb6.tar.bz2 |
recognize --option in addition to -option for most things
Diffstat (limited to 'util')
-rw-r--r-- | util/fbrun/main.cc | 21 | ||||
-rw-r--r-- | util/fbsetroot.cc | 23 |
2 files changed, 22 insertions, 22 deletions
diff --git a/util/fbrun/main.cc b/util/fbrun/main.cc index f9875d3..0bb8456 100644 --- a/util/fbrun/main.cc +++ b/util/fbrun/main.cc | |||
@@ -86,27 +86,28 @@ int main(int argc, char **argv) { | |||
86 | string history_file("~/.fluxbox/fbrun_history"); // command history file | 86 | string history_file("~/.fluxbox/fbrun_history"); // command history file |
87 | // parse arguments | 87 | // parse arguments |
88 | for (int i=1; i<argc; i++) { | 88 | for (int i=1; i<argc; i++) { |
89 | if (strcmp(argv[i], "-font") == 0 && i+1 < argc) { | 89 | string arg = argv[i]; |
90 | if ((arg == "-font" || arg == "--font") && i+1 < argc) { | ||
90 | fontname = argv[++i]; | 91 | fontname = argv[++i]; |
91 | } else if (strcmp(argv[i], "-print") == 0) { | 92 | } else if (arg == "-print" || arg == "--print") { |
92 | print = true; | 93 | print = true; |
93 | } else if (strcmp(argv[i], "-title") == 0 && i+1 < argc) { | 94 | } else if ((arg == "-title" || arg == "--title") && i+1 < argc) { |
94 | title = argv[++i]; | 95 | title = argv[++i]; |
95 | } else if (strcmp(argv[i], "-text") == 0 && i+1 < argc) { | 96 | } else if ((arg == "-text" || arg == "--text") && i+1 < argc) { |
96 | text = argv[++i]; | 97 | text = argv[++i]; |
97 | } else if (strcmp(argv[i], "-w") == 0 && i+1 < argc) { | 98 | } else if (arg == "-w" && i+1 < argc) { |
98 | width = atoi(argv[++i]); | 99 | width = atoi(argv[++i]); |
99 | set_width = true; | 100 | set_width = true; |
100 | } else if (strcmp(argv[i], "-h") == 0 && i+1 < argc) { | 101 | } else if (arg == "-h" && i+1 < argc) { |
101 | height = atoi(argv[++i]); | 102 | height = atoi(argv[++i]); |
102 | set_height = true; // mark true else the height of font will be used | 103 | set_height = true; // mark true else the height of font will be used |
103 | } else if (strcmp(argv[i], "-display") == 0 && i+1 < argc) { | 104 | } else if ((arg == "-display" || arg == "--display") && i+1 < argc) { |
104 | display_name = argv[++i]; | 105 | display_name = argv[++i]; |
105 | } else if (strcmp(argv[i], "-pos") == 0 && i+2 < argc) { | 106 | } else if ((arg == "-pos" || arg == "--pos") && i+2 < argc) { |
106 | x = atoi(argv[++i]); | 107 | x = atoi(argv[++i]); |
107 | y = atoi(argv[++i]); | 108 | y = atoi(argv[++i]); |
108 | set_pos = true; | 109 | set_pos = true; |
109 | } else if (strcmp(argv[i], "-nearmouse") == 0) { | 110 | } else if (arg == "-nearmouse" || arg == "--nearmouse") { |
110 | set_pos = true; | 111 | set_pos = true; |
111 | near_mouse = true; | 112 | near_mouse = true; |
112 | } else if (strcmp(argv[i], "-fg") == 0 && i+1 < argc) { | 113 | } else if (strcmp(argv[i], "-fg") == 0 && i+1 < argc) { |
@@ -117,7 +118,7 @@ int main(int argc, char **argv) { | |||
117 | antialias = false; | 118 | antialias = false; |
118 | } else if (strcmp(argv[i], "-hf") == 0 && i+1 < argc) { | 119 | } else if (strcmp(argv[i], "-hf") == 0 && i+1 < argc) { |
119 | history_file = argv[++i]; | 120 | history_file = argv[++i]; |
120 | } else if (strcmp(argv[i], "-h") == 0 || strcmp(argv[i], "-help") == 0) { | 121 | } else if (arg == "-h" || arg == "-help" || arg == "--help") { |
121 | showUsage(argv[0]); | 122 | showUsage(argv[0]); |
122 | exit(0); | 123 | exit(0); |
123 | } else { | 124 | } else { |
diff --git a/util/fbsetroot.cc b/util/fbsetroot.cc index 2312e37..cb55e16 100644 --- a/util/fbsetroot.cc +++ b/util/fbsetroot.cc | |||
@@ -67,30 +67,29 @@ fbsetroot::fbsetroot(int argc, char **argv, char *dpy_name) | |||
67 | img_ctrl = new FbTk::ImageControl(screen); | 67 | img_ctrl = new FbTk::ImageControl(screen); |
68 | 68 | ||
69 | for (; i < argc; i++) { | 69 | for (; i < argc; i++) { |
70 | if (! strcmp("-help", argv[i])) { | 70 | string arg = argv[i]; |
71 | if (arg == "-help" || arg == "--help" || arg == "-h") { | ||
71 | usage(); | 72 | usage(); |
72 | 73 | ||
73 | } else if ((! strcmp("-fg", argv[i])) || | 74 | } else if (arg == "-fg" || arg == "-foreground" || |
74 | (! strcmp("-foreground", argv[i])) || | 75 | arg == "--foreground" || arg == "-from" || arg == "--from") { |
75 | (! strcmp("-from", argv[i]))) { | ||
76 | if ((++i) >= argc) | 76 | if ((++i) >= argc) |
77 | usage(1); | 77 | usage(1); |
78 | fore = argv[i]; | 78 | fore = argv[i]; |
79 | 79 | ||
80 | } else if ((! strcmp("-bg", argv[i])) || | 80 | } else if (arg == "-bg" || arg == "-background" || |
81 | (! strcmp("-background", argv[i])) || | 81 | arg == "--background" || arg == "-to" || arg == "--to") { |
82 | (! strcmp("-to", argv[i]))) { | ||
83 | if ((++i) >= argc) | 82 | if ((++i) >= argc) |
84 | usage(1); | 83 | usage(1); |
85 | back = argv[i]; | 84 | back = argv[i]; |
86 | 85 | ||
87 | } else if (! strcmp("-solid", argv[i])) { | 86 | } else if (arg == "-solid" || arg == "--solid") { |
88 | if ((++i) >= argc) | 87 | if ((++i) >= argc) |
89 | usage(1); | 88 | usage(1); |
90 | fore = argv[i]; | 89 | fore = argv[i]; |
91 | sol = true; | 90 | sol = true; |
92 | 91 | ||
93 | } else if (! strcmp("-mod", argv[i])) { | 92 | } else if (arg == "-mod" || arg == "--mod") { |
94 | if ((++i) >= argc) | 93 | if ((++i) >= argc) |
95 | usage(); | 94 | usage(); |
96 | mod_x = atoi(argv[i]); | 95 | mod_x = atoi(argv[i]); |
@@ -103,14 +102,14 @@ fbsetroot::fbsetroot(int argc, char **argv, char *dpy_name) | |||
103 | mod_y = 1; | 102 | mod_y = 1; |
104 | mod = true; | 103 | mod = true; |
105 | 104 | ||
106 | } else if (! strcmp("-gradient", argv[i])) { | 105 | } else if (arg == "-gradient" || arg == "--gradient") { |
107 | if ((++i) >= argc) | 106 | if ((++i) >= argc) |
108 | usage(); | 107 | usage(); |
109 | 108 | ||
110 | grad = argv[i]; | 109 | grad = argv[i]; |
111 | grd = true; | 110 | grd = true; |
112 | 111 | ||
113 | } else if (! strcmp("-display", argv[i])) { | 112 | } else if (arg == "-display" || arg == "--display") { |
114 | // -display passed through tests earlier... we just skip it now | 113 | // -display passed through tests earlier... we just skip it now |
115 | i++; | 114 | i++; |
116 | 115 | ||
@@ -382,7 +381,7 @@ int main(int argc, char **argv) { | |||
382 | FbTk::NLSInit("fluxbox.cat"); | 381 | FbTk::NLSInit("fluxbox.cat"); |
383 | 382 | ||
384 | for (; i < argc; i++) { | 383 | for (; i < argc; i++) { |
385 | if (! strcmp(argv[i], "-display")) { | 384 | if (!strcmp(argv[i], "-display") || !strcmp(argv[i], "--display")) { |
386 | // check for -display option | 385 | // check for -display option |
387 | 386 | ||
388 | if ((++i) >= argc) { | 387 | if ((++i) >= argc) { |