diff options
Diffstat (limited to 'util/fbrun/main.cc')
-rw-r--r-- | util/fbrun/main.cc | 21 |
1 files changed, 11 insertions, 10 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 { |