]> git.ozlabs.org Git - petitboot/commitdiff
discover: Add --no-autoboot option
authorGeoff Levand <geoff@infradead.org>
Tue, 23 Jul 2013 19:09:18 +0000 (12:09 -0700)
committerGeoff Levand <geoff@infradead.org>
Tue, 23 Jul 2013 19:09:18 +0000 (12:09 -0700)
Add the command line option --no-autoboot to pb-discover
and update the pb-discover manpage.

Signed-off-by: Geoff Levand <geoff@infradead.org>
discover/pb-discover.c
man/pb-discover.8

index 986401d9fff6f434bff7c9c007f4e50548961341..007e66f2dcd671ae83058b257d9b4a72a43e785a 100644 (file)
@@ -28,7 +28,8 @@ static void print_usage(void)
 {
        print_version();
        printf(
-"Usage: pb-discover [-h, --help] [-l, --log log-file] [-V, --version]\n");
+"Usage: pb-discover [-a, --no-autoboot] [-h, --help] [-l, --log log-file]\n"
+"                   [-n, --dry-run] [-V, --version]\n");
 }
 
 /**
@@ -42,10 +43,11 @@ enum opt_value {opt_undef = 0, opt_yes, opt_no};
  */
 
 struct opts {
+       enum opt_value no_autoboot;
        enum opt_value show_help;
        const char *log_file;
-       enum opt_value show_version;
        enum opt_value dry_run;
+       enum opt_value show_version;
 };
 
 /**
@@ -55,14 +57,16 @@ struct opts {
 static int opts_parse(struct opts *opts, int argc, char *argv[])
 {
        static const struct option long_options[] = {
+               {"no-autoboot",    no_argument,       NULL, 'a'},
                {"help",           no_argument,       NULL, 'h'},
                {"log",            required_argument, NULL, 'l'},
                {"dry-run",        no_argument,       NULL, 'n'},
                {"version",        no_argument,       NULL, 'V'},
                { NULL, 0, NULL, 0},
        };
-       static const char short_options[] = "hl:nV";
+       static const char short_options[] = "ahl:nV";
        static const struct opts default_values = {
+               .no_autoboot = opt_no,
                .log_file = "/var/log/petitboot/pb-discover.log",
                .dry_run = opt_no,
        };
@@ -77,6 +81,9 @@ static int opts_parse(struct opts *opts, int argc, char *argv[])
                        break;
 
                switch (c) {
+               case 'a':
+                       opts->no_autoboot = opt_yes;
+                       break;
                case 'h':
                        opts->show_help = opt_yes;
                        break;
index 4f6bc3941917ed7e2dbbfb82b0be0d075456763c..65f9e6f1f4a025373ec89691c458473f0e8f97a9 100644 (file)
 .Sh SYNOPSIS
 .\" ========
 .Nm
+.Op Fl a, -no-autoboot
+.Op Fl h, -help
+.Op Fl l, -log Ar log-file
+.Op Fl n, -dry-run
+.Op Fl V, -version
 .\"
 .Sh DESCRIPTION
 .\" ===========
@@ -33,6 +38,28 @@ pb-discover maintains a dynamic list of boot options available to
 the system.  On startup, the petitboot user interface clients connect to
 pb-discover daemon and receive boot option information.
 .\"
+.Sh OPTIONS
+.\" =======
+.Bl -tag -width indent
+.\"
+.It Fl a, -no-autoboot
+Disable the autoboot feature.
+.\"
+.It Fl h, -help
+Print a help message.
+.\"
+.It Fl l, -log Ar log-file
+Log messages to the file
+.Ar log-file .
+The default log is a file /var/log/petitboot/pb-discover.log.  New messages are
+appended to an existing log file.
+.\"
+.It Fl d, -dry-run
+Do not execute any commands.  For testing.
+.\"
+.It Fl V, -version
+Display the program version number.
+.El
 .Sh SEE ALSO
 .\" ========
 .Xr petitboot 8 , Xr petitboot-nc 8 , Xr petitboot-twin 8 , Xr pb-event 8