diff --git a/man/initctl.8 b/man/initctl.8 index fbab638a..c6b283ad 100644 --- a/man/initctl.8 +++ b/man/initctl.8 @@ -11,7 +11,7 @@ .Nd Control tool for Finit .Sh SYNOPSIS .Nm /sbin/initctl -.Op Fl bcfhlpqtv +.Op Fl bcfhlpqtvV .Op COMMAND .Sh DESCRIPTION .Nm @@ -41,16 +41,20 @@ Silent, only return status of command. Skip table headings. .It Fl v, -verbose Verbose output, where applicable. +.It Fl V, -version +Show program version. .El .Sh COMMANDS .Bl -tag -width Ds .It Nm Ar debug -Toggle finit (daemon) debug to +Toggle +.Nm finit +(daemon) debug to .Pa /dev/console .It Nm Ar help Show built-in help text .It Nm Ar version -Show Finit (daemon) version +Show program version .It Nm Ar ls | list List all .Cm *.conf diff --git a/src/initctl.c b/src/initctl.c index c65c4a12..6d0c6488 100644 --- a/src/initctl.c +++ b/src/initctl.c @@ -891,12 +891,13 @@ static int usage(int rc) " -q, --quiet Silent, only return status of command\n" " -t, --no-heading Skip table headings\n" " -v, --verbose Verbose output\n" + " -R, --version Show program version\n" " -h, --help This help text\n" "\n" "Commands:\n" " debug Toggle Finit (daemon) debug\n" " help This help text\n" - " version Show Finit version\n" + " version Show program version\n" "\n", prognm); if (has_rcsd) @@ -1031,6 +1032,7 @@ int main(int argc, char *argv[]) { "quiet", 0, NULL, 'q' }, { "no-heading", 0, NULL, 't' }, { "verbose", 0, NULL, 'v' }, + { "version", 0, NULL, 'V' }, { NULL, 0, NULL, 0 } }; struct cmd cond[] = { @@ -1090,7 +1092,7 @@ int main(int argc, char *argv[]) cgrp = cgroup_avail(); utmp = has_utmp(); - while ((c = getopt_long(argc, argv, "1bcdfh?pqtv", long_options, NULL)) != EOF) { + while ((c = getopt_long(argc, argv, "1bcdfh?pqtvV", long_options, NULL)) != EOF) { switch(c) { case '1': ionce = 1; @@ -1131,6 +1133,9 @@ int main(int argc, char *argv[]) case 'v': verbose = 1; break; + + case 'V': + return show_version(NULL); } }