diff options
-rw-r--r-- | sway/commands.c | 22 |
1 files changed, 11 insertions, 11 deletions
diff --git a/sway/commands.c b/sway/commands.c index c2458278..da33c5de 100644 --- a/sway/commands.c +++ b/sway/commands.c | |||
@@ -32,7 +32,7 @@ static struct modifier_key modifiers[] = { | |||
32 | enum expected_args { | 32 | enum expected_args { |
33 | EXPECTED_MORE_THAN, | 33 | EXPECTED_MORE_THAN, |
34 | EXPECTED_LESS_THAN, | 34 | EXPECTED_LESS_THAN, |
35 | EXPECTED_SAME_AS | 35 | EXPECTED_EQUAL_TO |
36 | }; | 36 | }; |
37 | 37 | ||
38 | static bool checkarg(int argc, char *name, enum expected_args type, int val) { | 38 | static bool checkarg(int argc, char *name, enum expected_args type, int val) { |
@@ -53,7 +53,7 @@ static bool checkarg(int argc, char *name, enum expected_args type, int val) { | |||
53 | "(expected less then %d argument%s, got %d", | 53 | "(expected less then %d argument%s, got %d", |
54 | name, val, (char*[2]){"s", ""}[argc==1], argc); | 54 | name, val, (char*[2]){"s", ""}[argc==1], argc); |
55 | break; | 55 | break; |
56 | case EXPECTED_SAME_AS: | 56 | case EXPECTED_EQUAL_TO: |
57 | if (argc == val) { | 57 | if (argc == val) { |
58 | return true; | 58 | return true; |
59 | }; | 59 | }; |
@@ -144,7 +144,7 @@ static bool cmd_exec(struct sway_config *config, int argc, char **argv) { | |||
144 | } | 144 | } |
145 | 145 | ||
146 | static bool cmd_exit(struct sway_config *config, int argc, char **argv) { | 146 | static bool cmd_exit(struct sway_config *config, int argc, char **argv) { |
147 | if (!checkarg(argc, "exit", EXPECTED_SAME_AS, 0)) { | 147 | if (!checkarg(argc, "exit", EXPECTED_EQUAL_TO, 0)) { |
148 | return false; | 148 | return false; |
149 | } | 149 | } |
150 | // TODO: Some kind of clean up is probably in order | 150 | // TODO: Some kind of clean up is probably in order |
@@ -153,7 +153,7 @@ static bool cmd_exit(struct sway_config *config, int argc, char **argv) { | |||
153 | } | 153 | } |
154 | 154 | ||
155 | static bool cmd_focus(struct sway_config *config, int argc, char **argv) { | 155 | static bool cmd_focus(struct sway_config *config, int argc, char **argv) { |
156 | if (!checkarg(argc, "focus", EXPECTED_SAME_AS, 1)) { | 156 | if (!checkarg(argc, "focus", EXPECTED_EQUAL_TO, 1)) { |
157 | return false; | 157 | return false; |
158 | } | 158 | } |
159 | if (strcasecmp(argv[0], "left") == 0) { | 159 | if (strcasecmp(argv[0], "left") == 0) { |
@@ -171,7 +171,7 @@ static bool cmd_focus(struct sway_config *config, int argc, char **argv) { | |||
171 | } | 171 | } |
172 | 172 | ||
173 | static bool cmd_focus_follows_mouse(struct sway_config *config, int argc, char **argv) { | 173 | static bool cmd_focus_follows_mouse(struct sway_config *config, int argc, char **argv) { |
174 | if (!checkarg(argc, "focus_follows_mouse", EXPECTED_SAME_AS, 1)) { | 174 | if (!checkarg(argc, "focus_follows_mouse", EXPECTED_EQUAL_TO, 1)) { |
175 | return false; | 175 | return false; |
176 | } | 176 | } |
177 | 177 | ||
@@ -204,7 +204,7 @@ static bool cmd_layout(struct sway_config *config, int argc, char **argv) { | |||
204 | } | 204 | } |
205 | 205 | ||
206 | static bool cmd_reload(struct sway_config *config, int argc, char **argv) { | 206 | static bool cmd_reload(struct sway_config *config, int argc, char **argv) { |
207 | if (!checkarg(argc, "reload", EXPECTED_SAME_AS, 0)) { | 207 | if (!checkarg(argc, "reload", EXPECTED_EQUAL_TO, 0)) { |
208 | return false; | 208 | return false; |
209 | } | 209 | } |
210 | if (!load_config()) { | 210 | if (!load_config()) { |
@@ -215,7 +215,7 @@ static bool cmd_reload(struct sway_config *config, int argc, char **argv) { | |||
215 | } | 215 | } |
216 | 216 | ||
217 | static bool cmd_set(struct sway_config *config, int argc, char **argv) { | 217 | static bool cmd_set(struct sway_config *config, int argc, char **argv) { |
218 | if (!checkarg(argc, "set", EXPECTED_SAME_AS, 2)) { | 218 | if (!checkarg(argc, "set", EXPECTED_EQUAL_TO, 2)) { |
219 | return false; | 219 | return false; |
220 | } | 220 | } |
221 | struct sway_variable *var = malloc(sizeof(struct sway_variable)); | 221 | struct sway_variable *var = malloc(sizeof(struct sway_variable)); |
@@ -231,7 +231,7 @@ static bool _do_split(struct sway_config *config, int argc, char **argv, int lay | |||
231 | char *name = layout == L_VERT ? "splitv": | 231 | char *name = layout == L_VERT ? "splitv": |
232 | layout == L_HORIZ ? "splith": | 232 | layout == L_HORIZ ? "splith": |
233 | "split"; | 233 | "split"; |
234 | if (!checkarg(argc, name, EXPECTED_SAME_AS, 0)) { | 234 | if (!checkarg(argc, name, EXPECTED_EQUAL_TO, 0)) { |
235 | return false; | 235 | return false; |
236 | } | 236 | } |
237 | swayc_t *focused = get_focused_container(&root_container); | 237 | swayc_t *focused = get_focused_container(&root_container); |
@@ -263,7 +263,7 @@ static bool cmd_splith(struct sway_config *config, int argc, char **argv) { | |||
263 | } | 263 | } |
264 | 264 | ||
265 | static bool cmd_log_colors(struct sway_config *config, int argc, char **argv) { | 265 | static bool cmd_log_colors(struct sway_config *config, int argc, char **argv) { |
266 | if (!checkarg(argc, "log_colors", EXPECTED_SAME_AS, 1)) { | 266 | if (!checkarg(argc, "log_colors", EXPECTED_EQUAL_TO, 1)) { |
267 | return false; | 267 | return false; |
268 | } | 268 | } |
269 | if (strcasecmp(argv[0], "no") != 0 && strcasecmp(argv[0], "yes") != 0) { | 269 | if (strcasecmp(argv[0], "no") != 0 && strcasecmp(argv[0], "yes") != 0) { |
@@ -276,7 +276,7 @@ static bool cmd_log_colors(struct sway_config *config, int argc, char **argv) { | |||
276 | } | 276 | } |
277 | 277 | ||
278 | static bool cmd_fullscreen(struct sway_config *config, int argc, char **argv) { | 278 | static bool cmd_fullscreen(struct sway_config *config, int argc, char **argv) { |
279 | if (!checkarg(argc, "fullscreen", EXPECTED_SAME_AS, 0)) { | 279 | if (!checkarg(argc, "fullscreen", EXPECTED_EQUAL_TO, 0)) { |
280 | return false; | 280 | return false; |
281 | } | 281 | } |
282 | 282 | ||
@@ -289,7 +289,7 @@ static bool cmd_fullscreen(struct sway_config *config, int argc, char **argv) { | |||
289 | } | 289 | } |
290 | 290 | ||
291 | static bool cmd_workspace(struct sway_config *config, int argc, char **argv) { | 291 | static bool cmd_workspace(struct sway_config *config, int argc, char **argv) { |
292 | if (!checkarg(argc, "workspace", EXPECTED_SAME_AS, 1)) { | 292 | if (!checkarg(argc, "workspace", EXPECTED_EQUAL_TO, 1)) { |
293 | return false; | 293 | return false; |
294 | } | 294 | } |
295 | 295 | ||