diff options
Diffstat (limited to 'src/udev/udevadm-trigger.c')
-rw-r--r-- | src/udev/udevadm-trigger.c | 11 |
1 files changed, 8 insertions, 3 deletions
diff --git a/src/udev/udevadm-trigger.c b/src/udev/udevadm-trigger.c index e2ce317e01..f78a2ba437 100644 --- a/src/udev/udevadm-trigger.c +++ b/src/udev/udevadm-trigger.c @@ -1,3 +1,4 @@ +/* SPDX-License-Identifier: GPL-2.0+ */ /* * Copyright (C) 2008-2009 Kay Sievers <kay@vrfy.org> * @@ -67,10 +68,10 @@ static const char *keyval(const char *str, const char **val, char *buf, size_t s } static void help(void) { - printf("%s trigger OPTIONS\n\n" + printf("%s trigger [OPTIONS] DEVPATH\n\n" "Request events from the kernel.\n\n" " -h --help Show this help\n" - " --version Show package version\n" + " -V --version Show package version\n" " -v --verbose Print the list of devices while running\n" " -n --dry-run Do not actually trigger the events\n" " -t --type= Type of events to trigger\n" @@ -108,6 +109,7 @@ static int adm_trigger(struct udev *udev, int argc, char *argv[]) { { "sysname-match", required_argument, NULL, 'y' }, { "name-match", required_argument, NULL, ARG_NAME }, { "parent-match", required_argument, NULL, 'b' }, + { "version", no_argument, NULL, 'V' }, { "help", no_argument, NULL, 'h' }, {} }; @@ -123,7 +125,7 @@ static int adm_trigger(struct udev *udev, int argc, char *argv[]) { if (udev_enumerate == NULL) return 1; - while ((c = getopt_long(argc, argv, "vno:t:c:s:S:a:A:p:g:y:b:h", options, NULL)) >= 0) { + while ((c = getopt_long(argc, argv, "vnt:c:s:S:a:A:p:g:y:b:Vh", options, NULL)) >= 0) { const char *key; const char *val; char buf[UTIL_PATH_SIZE]; @@ -239,6 +241,9 @@ static int adm_trigger(struct udev *udev, int argc, char *argv[]) { break; } + case 'V': + print_version(); + return 0; case 'h': help(); return 0; |