diff options
Diffstat (limited to 'src/udev/dmi_memory_id/dmi_memory_id.c')
-rw-r--r-- | src/udev/dmi_memory_id/dmi_memory_id.c | 11 |
1 files changed, 8 insertions, 3 deletions
diff --git a/src/udev/dmi_memory_id/dmi_memory_id.c b/src/udev/dmi_memory_id/dmi_memory_id.c index 1345289219..dd46113137 100644 --- a/src/udev/dmi_memory_id/dmi_memory_id.c +++ b/src/udev/dmi_memory_id/dmi_memory_id.c @@ -45,6 +45,7 @@ #include <getopt.h> #include "alloc-util.h" +#include "build.h" #include "fileio.h" #include "main-func.h" #include "string-util.h" @@ -638,9 +639,10 @@ static int legacy_decode(const uint8_t *buf, const char *devmem, bool no_file_of } static int help(void) { - printf("Usage: %s [options]\n" - " -F,--from-dump FILE read DMI information from a binary file\n" - " -h,--help print this help text\n\n", + printf("%s [OPTIONS...]\n\n" + " -F --from-dump FILE Read DMI information from a binary file\n" + " -h --help Show this help text\n" + " --version Show package version\n", program_invocation_short_name); return 0; } @@ -650,6 +652,7 @@ static int parse_argv(int argc, char * const *argv) { { "from-dump", required_argument, NULL, 'F' }, { "version", no_argument, NULL, 'V' }, { "help", no_argument, NULL, 'h' }, + { "version", no_argument, NULL, 'v' }, {} }; int c; @@ -666,6 +669,8 @@ static int parse_argv(int argc, char * const *argv) { return help(); case '?': return -EINVAL; + case 'v': + return version(); default: assert_not_reached(); } |