New optional EXIT_STATUS argument for 'quit'

Also removed the 'reload' message because of its uselessness.
This commit is contained in:
Bastien Dejean 2012-12-24 12:02:35 +01:00
parent 243b39d3b8
commit 62f32bc655
5 changed files with 8 additions and 12 deletions

View file

@ -206,10 +206,7 @@ The following messages are handled:
reload_settings
Reload the default settings.
reload
Reload the autostart file and the default settings.
quit
quit [EXIT_STATUS]
Quit.
## Settings

View file

@ -229,10 +229,7 @@ Reload the autostart file.
.BI reload_settings
Reload the default settings.
.TP
.BI reload
Reload the autostart file and the default settings.
.TP
.BI quit
.BI quit " [EXIT_STATUS]"
Quit.
.SH SETTINGS
Colors are either

View file

@ -139,6 +139,7 @@ void setup(void)
last_entered = XCB_NONE;
split_mode = MODE_AUTOMATIC;
visible = true;
exit_status = 0;
}
int main(int argc, char *argv[])
@ -250,5 +251,5 @@ int main(int argc, char *argv[])
free(ewmh);
xcb_flush(dpy);
xcb_disconnect(dpy);
return 0;
return exit_status;
}

View file

@ -28,6 +28,7 @@ rule_t *rule_head;
pointer_state_t *frozen_pointer;
xcb_point_t pointer_position;
xcb_window_t last_entered;
int exit_status;
bool visible;
bool running;

View file

@ -343,14 +343,14 @@ void process_message(char *msg, char *rsp)
return;
} else if (strcmp(cmd, "adopt_orphans") == 0) {
adopt_orphans();
} else if (strcmp(cmd, "reload") == 0) {
load_settings();
run_autostart();
} else if (strcmp(cmd, "reload_autostart") == 0) {
run_autostart();
} else if (strcmp(cmd, "reload_settings") == 0) {
load_settings();
} else if (strcmp(cmd, "quit") == 0) {
char *arg = strtok(NULL, TOK_SEP);
if (arg != NULL)
sscanf(arg, "%i", &exit_status);
quit();
return;
} else {