X-Git-Url: https://git.ozlabs.org/?a=blobdiff_plain;f=ui%2Fncurses%2Fgeneric-main.c;h=67b0b618fac704d7ec25447561adcd1e9b16f627;hb=0dd467aef0f1e104faf8ad5b1d4deaaf71732278;hp=ad4c0cf9b8f3a1067591482912e648cd4c94d623;hpb=e6427db8266f5964d14679c53b55da8e3ee0233c;p=petitboot diff --git a/ui/ncurses/generic-main.c b/ui/ncurses/generic-main.c index ad4c0cf..67b0b61 100644 --- a/ui/ncurses/generic-main.c +++ b/ui/ncurses/generic-main.c @@ -49,7 +49,7 @@ static void print_usage(void) print_version(); printf( "Usage: petitboot-nc [-h, --help] [-l, --log log-file]\n" -" [-s, --start-daemon] [-V, --version]\n"); +" [-s, --start-daemon] [-v, --verbose] [-V, --version]\n"); } /** @@ -66,6 +66,7 @@ struct opts { enum opt_value show_help; const char *log_file; enum opt_value start_daemon; + enum opt_value verbose; enum opt_value show_version; }; @@ -79,10 +80,11 @@ static int opts_parse(struct opts *opts, int argc, char *argv[]) {"help", no_argument, NULL, 'h'}, {"log", required_argument, NULL, 'l'}, {"start-daemon", no_argument, NULL, 's'}, + {"verbose", no_argument, NULL, 'v'}, {"version", no_argument, NULL, 'V'}, { NULL, 0, NULL, 0}, }; - static const char short_options[] = "dhl:sV"; + static const char short_options[] = "dhl:svV"; static const struct opts default_values = { 0 }; *opts = default_values; @@ -104,6 +106,9 @@ static int opts_parse(struct opts *opts, int argc, char *argv[]) case 's': opts->start_daemon = opt_yes; break; + case 'v': + opts->verbose = opt_yes; + break; case 'V': opts->show_version = opt_yes; break; @@ -297,6 +302,9 @@ int main(int argc, char *argv[]) pb_log_init(log); + if (opts.verbose) + pb_log_set_debug(true); + pb_log("--- petitboot-nc ---\n"); sa.sa_handler = sig_handler;