mirror of
https://github.com/gwenhael-le-moine/sway-patched-tray-menu.git
synced 2024-12-28 22:23:42 +01:00
gaps: Improve error reporting
Always raise an error if the runtime only gaps command is found in the config file.
This commit is contained in:
parent
60df5cc9f8
commit
67866dc378
1 changed files with 8 additions and 7 deletions
|
@ -149,16 +149,17 @@ struct cmd_results *cmd_gaps(int argc, char **argv) {
|
||||||
return error;
|
return error;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
bool config_loading = !config->active || config->reloading;
|
||||||
|
|
||||||
if (argc == 2) {
|
if (argc == 2) {
|
||||||
return gaps_set_defaults(argc, argv);
|
return gaps_set_defaults(argc, argv);
|
||||||
}
|
}
|
||||||
if (argc == 4) {
|
if (argc == 4 && !config_loading) {
|
||||||
if (config->active) {
|
|
||||||
return gaps_set_runtime(argc, argv);
|
return gaps_set_runtime(argc, argv);
|
||||||
} else {
|
|
||||||
return cmd_results_new(CMD_INVALID, "gaps",
|
|
||||||
"This syntax can only be used when sway is running");
|
|
||||||
}
|
}
|
||||||
|
if (config_loading) {
|
||||||
|
return cmd_results_new(CMD_INVALID, "gaps",
|
||||||
|
"Expected 'gaps inner|outer <px>'");
|
||||||
}
|
}
|
||||||
return cmd_results_new(CMD_INVALID, "gaps",
|
return cmd_results_new(CMD_INVALID, "gaps",
|
||||||
"Expected 'gaps inner|outer <px>' or "
|
"Expected 'gaps inner|outer <px>' or "
|
||||||
|
|
Loading…
Reference in a new issue