From dbf139003bd6c8c6ca03ae7f533aa74afd8060c6 Mon Sep 17 00:00:00 2001 From: Jeremy Kerr Date: Thu, 7 Mar 2013 10:22:42 +0800 Subject: Move --dry-run option to discover server Now that the server does the booting, we should move the --dry-run argument to the server. Signed-off-by: Jeremy Kerr --- discover/pb-discover.c | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) (limited to 'discover/pb-discover.c') diff --git a/discover/pb-discover.c b/discover/pb-discover.c index 536f6e6..c83b574 100644 --- a/discover/pb-discover.c +++ b/discover/pb-discover.c @@ -43,6 +43,7 @@ struct opts { enum opt_value show_help; const char *log_file; enum opt_value show_version; + enum opt_value dry_run; }; /** @@ -54,12 +55,14 @@ static int opts_parse(struct opts *opts, int argc, char *argv[]) static const struct option long_options[] = { {"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:V"; + static const char short_options[] = "hl:nV"; static const struct opts default_values = { .log_file = "/var/log/petitboot/pb-discover.log", + .dry_run = opt_no, }; *opts = default_values; @@ -78,6 +81,9 @@ static int opts_parse(struct opts *opts, int argc, char *argv[]) case 'l': opts->log_file = optarg; break; + case 'n': + opts->dry_run = opt_yes; + break; case 'V': opts->show_version = opt_yes; break; @@ -145,7 +151,7 @@ int main(int argc, char *argv[]) if (!server) return EXIT_FAILURE; - handler = device_handler_init(server); + handler = device_handler_init(server, opts.dry_run == opt_yes); if (!handler) return EXIT_FAILURE; -- cgit v1.2.1