diff options
author | Zbigniew Jędrzejewski-Szmek <zbyszek@in.waw.pl> | 2013-12-16 22:40:09 -0500 |
---|---|---|
committer | Zbigniew Jędrzejewski-Szmek <zbyszek@in.waw.pl> | 2013-12-16 23:21:51 -0500 |
commit | a94200d0b4a8f98e5d9433282642300082de7d59 (patch) | |
tree | 029879b40307518bb89381357a7f5b1f79c5d93c /src | |
parent | c0fdf09885ce83cc7edc31f51b03ef284980dfa8 (diff) |
bus-driverd: actually add --version
Diffstat (limited to 'src')
-rw-r--r-- | src/bus-driverd/bus-driverd.c | 12 |
1 files changed, 5 insertions, 7 deletions
diff --git a/src/bus-driverd/bus-driverd.c b/src/bus-driverd/bus-driverd.c index e3d32ec548..ce2e1b2138 100644 --- a/src/bus-driverd/bus-driverd.c +++ b/src/bus-driverd/bus-driverd.c @@ -81,8 +81,9 @@ static int parse_argv(int argc, char *argv[]) { }; static const struct option options[] = { - { "help", no_argument, NULL, 'h' }, - { NULL, 0, NULL, 0 } + { "help", no_argument, NULL, 'h' }, + { "version", no_argument, NULL, ARG_VERSION }, + {} }; int c; @@ -90,8 +91,7 @@ static int parse_argv(int argc, char *argv[]) { assert(argc >= 0); assert(argv); - while ((c = getopt_long(argc, argv, "h", options, NULL)) >= 0) { - + while ((c = getopt_long(argc, argv, "h", options, NULL)) >= 0) switch (c) { case 'h': @@ -107,10 +107,8 @@ static int parse_argv(int argc, char *argv[]) { return -EINVAL; default: - log_error("Unknown option code %c", c); - return -EINVAL; + assert_not_reached("Unknown option"); } - } return 1; } |