From e5931bb7d86226a3823bdf5f4ec01c857827d386 Mon Sep 17 00:00:00 2001 From: Kay Sievers Date: Sun, 7 Sep 2008 14:48:33 +0200 Subject: [PATCH] udevadm: add --version --help options to man page, hide them as commands --- extras/volume_id/vol_id.xml | 2 +- udev/udevadm.c | 8 +++---- udev/udevadm.xml | 42 ++++++++++++++++++++++++------------- udev/udevd.xml | 4 ++-- 4 files changed, 34 insertions(+), 22 deletions(-) diff --git a/extras/volume_id/vol_id.xml b/extras/volume_id/vol_id.xml index fcf3a31f..3ab0b05c 100644 --- a/extras/volume_id/vol_id.xml +++ b/extras/volume_id/vol_id.xml @@ -107,7 +107,7 @@ - Print debug output to stderr. + Print debug messages to stderr. diff --git a/udev/udevadm.c b/udev/udevadm.c index e4f24205..bfa704ef 100644 --- a/udev/udevadm.c +++ b/udev/udevadm.c @@ -63,7 +63,8 @@ static int help(struct udev *udev, int argc, char *argv[]) printf("Usage: udevadm [--help] [--version] [--debug] COMMAND [COMMAND OPTIONS]\n"); for (cmd = cmds; cmd->name != NULL; cmd++) - printf(" %-12s %s\n", cmd->name, cmd->help); + if (cmd->help != NULL) + printf(" %-12s %s\n", cmd->name, cmd->help); printf("\n"); return 0; } @@ -103,12 +104,10 @@ static const struct command cmds[] = { { .name = "version", .cmd = version, - .help = "print the version number", }, { .name = "help", .cmd = help, - .help = "print this help text", }, {} }; @@ -210,7 +209,8 @@ int main(int argc, char *argv[]) } } - fprintf(stderr, "unknown command, try udevadm help\n\n"); + fprintf(stderr, "missing or unknown command\n\n"); + help(udev, argc, argv); rc = 2; out: sysfs_cleanup(); diff --git a/udev/udevadm.xml b/udev/udevadm.xml index 2e02c305..07589084 100644 --- a/udev/udevadm.xml +++ b/udev/udevadm.xml @@ -24,7 +24,13 @@ - udevadm info options + udevadm + + + + + + udevadm info options udevadm trigger options @@ -41,12 +47,6 @@ udevadm test options devpath - - udevadm version - - - udevadm help - DESCRIPTION @@ -56,6 +56,26 @@ OPTIONS + + + + + Print debug messages to stderr. + + + + + + Print version number. + + + + + + Print help text. + + + udevadm info <replaceable>options</replaceable> Queries the udev database for device information @@ -351,14 +371,6 @@ - - udevadm version - Print version number. - - - udevadm help - Print help text. - AUTHOR diff --git a/udev/udevd.xml b/udev/udevd.xml index 8d22a0c1..b5726b8b 100644 --- a/udev/udevd.xml +++ b/udev/udevd.xml @@ -61,7 +61,7 @@ - Print log messages to stdout. + Print debug messages to stderr. @@ -71,7 +71,7 @@ - + Print help text. -- 2.39.5