initctl: Sort commands in usage according to topic

Signed-off-by: Joachim Nilsson <troglobit@gmail.com>
This commit is contained in:
Joachim Nilsson committed 2017-06-30 12:12:13 +02:00
1 parent 3428cd48b7
commit 018a87286c
1 file changed
+26 -13
+26 -13
View File
@@ -574,66 +574,79 @@ static int show_status(char *arg)
static int usage(int rc) static int usage(int rc)
{ {
fprintf(stderr, "Usage: %s [OPTIONS] <COMMAND>\n\n" fprintf(stderr,
"Usage: %s [OPTIONS] <COMMAND>\n"
"\n"
"Options:\n" "Options:\n"
" -d, --debug Debug initctl (client)\n" " -d, --debug Debug initctl (client)\n"
" -v, --verbose Verbose output\n" " -v, --verbose Verbose output\n"
" -h, --help This help text\n\n" " -h, --help This help text\n"
"\n"
"Commands:\n" "Commands:\n"
" debug Toggle Finit (daemon) debug\n" " debug Toggle Finit (daemon) debug\n"
" help This help text\n" " help This help text\n"
" log [NAME] Show ten last Finit, or NAME, messages from syslog\n" " version Show Finit version\n"
" reload Reload *.conf in /etc/finit.d and activate changes\n"
" runlevel [0-9] Show or set runlevel: 0 halt, 6 reboot\n"
" status | show Show status of services\n"
"\n" "\n"
" list List all .conf in /etc/finit.d/\n" " list List all .conf in /etc/finit.d/\n"
" enable <CONF> Enable .conf in /etc/finit.d/available/\n" " enable <CONF> Enable .conf in /etc/finit.d/available/\n"
" disable <CONF> Disable .conf in /etc/finit.d/[enabled/]\n" " disable <CONF> Disable .conf in /etc/finit.d/[enabled/]\n"
" reload Reload *.conf in /etc/finit.d/ (activates changes)\n"
"\n" "\n"
" cond set <COND> Set (assert) condition => +COND\n" " cond set <COND> Set (assert) condition => +COND\n"
" cond clear <COND> Clear (deassert) condition => -COND\n" " cond clear <COND> Clear (deassert) condition => -COND\n"
" cond show Show condition status\n" " cond show Show condition status\n"
" cond dump Show all conditions and their status\n" " cond dump Show all conditions and their status\n"
"\n" "\n"
" log [NAME] Show ten last Finit, or NAME, messages from syslog\n"
" start <JOB|NAME>[:ID] Start service by job# or name, with optional ID\n" " start <JOB|NAME>[:ID] Start service by job# or name, with optional ID\n"
" stop <JOB|NAME>[:ID] Stop/Pause a running service by job# or name\n" " stop <JOB|NAME>[:ID] Stop/Pause a running service by job# or name\n"
" restart <JOB|NAME>[:ID] Restart (stop/start) service by job# or name\n" " restart <JOB|NAME>[:ID] Restart (stop/start) service by job# or name\n"
" status | show Show status of services\n"
"\n" "\n"
" runlevel [0-9] Show or set runlevel: 0 halt, 6 reboot\n"
" reboot Reboot system\n" " reboot Reboot system\n"
" halt Halt system\n" " halt Halt system\n"
" poweroff Halt and power off system\n" " poweroff Halt and power off system\n"
"\n" "\n"
" utmp show Raw dump of UTMP/WTMP db\n" " utmp show Raw dump of UTMP/WTMP db\n"
" version Show Finit version\n\n", prognm); "\n", prognm);
return rc; return rc;
} }
static int do_help(char *arg)
{
return usage(0);
}
int main(int argc, char *argv[]) int main(int argc, char *argv[])
{ {
int c; int c;
command_t command[] = { command_t command[] = {
{ "debug", toggle_debug }, { "debug", toggle_debug },
{ "log", do_log }, { "help", do_help },
{ "reload", do_reload }, { "version", show_version },
{ "runlevel", do_runlevel },
{ "status", show_status },
{ "show", show_status }, /* Convenience alias */
{ "list", serv_list }, { "list", serv_list },
{ "enable", serv_enable }, { "enable", serv_enable },
{ "disable", serv_disable }, { "disable", serv_disable },
{ "reload", do_reload },
{ "cond", do_cond }, { "cond", do_cond },
{ "log", do_log },
{ "start", do_start }, { "start", do_start },
{ "stop", do_stop }, { "stop", do_stop },
{ "restart", do_restart }, { "restart", do_restart },
{ "status", show_status },
{ "show", show_status }, /* Convenience alias */
{ "runlevel", do_runlevel },
{ "reboot", do_reboot }, { "reboot", do_reboot },
{ "halt", do_halt }, { "halt", do_halt },
{ "poweroff", do_poweroff }, { "poweroff", do_poweroff },
{ "utmp", do_utmp }, { "utmp", do_utmp },
{ "version", show_version },
{ NULL, NULL } { NULL, NULL }
}; };
struct option long_options[] = { struct option long_options[] = {