diff options
author | Yu Watanabe <watanabe.yu+github@gmail.com> | 2017-12-05 23:30:10 +0900 |
---|---|---|
committer | Yu Watanabe <watanabe.yu+github@gmail.com> | 2017-12-05 23:30:10 +0900 |
commit | 5639df9a80a828f66ac1ab703dd4fe21a0fc1d19 (patch) | |
tree | b0b88b8add1eb360ab7016ddb64cac51f36a062b /src/udev/udevadm-settle.c | |
parent | a135d2710532f69902038fa8b07ed083e9d79d36 (diff) | |
download | systemd-5639df9a80a828f66ac1ab703dd4fe21a0fc1d19.tar.gz |
udevadm: getopt() and help message cleanup
This adds missing options, mainly '--version' in getopt(), removes
an unused option from getopt().
Also, this adds a deprecate message in `udevadm hwdb`, and cleanups
help messages.
Follow-up for 65eb4378c3e1de25383d8cd606909e64c71edc80.
Diffstat (limited to 'src/udev/udevadm-settle.c')
-rw-r--r-- | src/udev/udevadm-settle.c | 12 |
1 files changed, 9 insertions, 3 deletions
diff --git a/src/udev/udevadm-settle.c b/src/udev/udevadm-settle.c index d72b6ffe20..0af3e6412b 100644 --- a/src/udev/udevadm-settle.c +++ b/src/udev/udevadm-settle.c @@ -29,13 +29,14 @@ #include "parse-util.h" #include "udev.h" +#include "udevadm-util.h" #include "util.h" static void help(void) { - printf("%s settle OPTIONS\n\n" + printf("%s settle [OPTIONS]\n\n" "Wait for pending udev events.\n\n" " -h --help Show this help\n" - " --version Show package version\n" + " -V --version Show package version\n" " -t --timeout=SECONDS Maximum time to wait for events\n" " -E --exit-if-exists=FILE Stop waiting if file exists\n" , program_invocation_short_name); @@ -45,6 +46,7 @@ static int adm_settle(struct udev *udev, int argc, char *argv[]) { static const struct option options[] = { { "timeout", required_argument, NULL, 't' }, { "exit-if-exists", required_argument, NULL, 'E' }, + { "version", no_argument, NULL, 'V' }, { "help", no_argument, NULL, 'h' }, { "seq-start", required_argument, NULL, 's' }, /* removed */ { "seq-end", required_argument, NULL, 'e' }, /* removed */ @@ -59,7 +61,7 @@ static int adm_settle(struct udev *udev, int argc, char *argv[]) { struct udev_queue *queue; int rc = EXIT_FAILURE; - while ((c = getopt_long(argc, argv, "t:E:hs:e:q", options, NULL)) >= 0) { + while ((c = getopt_long(argc, argv, "t:E:Vhs:e:q", options, NULL)) >= 0) { switch (c) { case 't': { @@ -77,6 +79,10 @@ static int adm_settle(struct udev *udev, int argc, char *argv[]) { exists = optarg; break; + case 'V': + print_version(); + return EXIT_SUCCESS; + case 'h': help(); return EXIT_SUCCESS; |