summaryrefslogtreecommitdiffstats
path: root/src/udev/udevadm-trigger.c
diff options
context:
space:
mode:
authorYu Watanabe <watanabe.yu+github@gmail.com>2019-06-28 21:03:06 +0200
committerYu Watanabe <watanabe.yu+github@gmail.com>2019-06-28 21:10:14 +0200
commit6d22bd87f0d9505721dfa0ec5ae94f39a1691526 (patch)
tree8a9902298772a257d738cbda71b2b6761477e5eb /src/udev/udevadm-trigger.c
parentsd-device: introduce dump_device_action_table() (diff)
downloadsystemd-6d22bd87f0d9505721dfa0ec5ae94f39a1691526.tar.xz
systemd-6d22bd87f0d9505721dfa0ec5ae94f39a1691526.zip
udevadm: support special value 'help' for --action option
Diffstat (limited to 'src/udev/udevadm-trigger.c')
-rw-r--r--src/udev/udevadm-trigger.c6
1 files changed, 5 insertions, 1 deletions
diff --git a/src/udev/udevadm-trigger.c b/src/udev/udevadm-trigger.c
index f14010a2d0..77d95e513f 100644
--- a/src/udev/udevadm-trigger.c
+++ b/src/udev/udevadm-trigger.c
@@ -115,7 +115,7 @@ static int help(void) {
" -t --type= Type of events to trigger\n"
" devices sysfs devices (default)\n"
" subsystems sysfs subsystems and drivers\n"
- " -c --action=ACTION Event action value, default is \"change\"\n"
+ " -c --action=ACTION|help Event action value, default is \"change\"\n"
" -s --subsystem-match=SUBSYSTEM Trigger devices from a matching subsystem\n"
" -S --subsystem-nomatch=SUBSYSTEM Exclude devices from a matching subsystem\n"
" -a --attr-match=FILE[=VALUE] Trigger devices with a matching attribute\n"
@@ -205,6 +205,10 @@ int trigger_main(int argc, char *argv[], void *userdata) {
return log_error_errno(SYNTHETIC_ERRNO(EINVAL), "Unknown type --type=%s", optarg);
break;
case 'c':
+ if (streq(optarg, "help")) {
+ dump_device_action_table();
+ return 0;
+ }
if (device_action_from_string(optarg) < 0)
return log_error_errno(SYNTHETIC_ERRNO(EINVAL), "Unknown action '%s'", optarg);