summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorKay Sievers <kay.sievers@vrfy.org>2007-11-09 00:49:50 +0100
committerKay Sievers <kay.sievers@vrfy.org>2007-11-09 00:49:50 +0100
commit3ca494515ccc7ba3cdfa946325bcf0273b899510 (patch)
treeab5427c6bf86e155670b8f29e8798c17f7c594b1
parent225cb03bd851adc6d269b13bdf2b1bfded2b96b9 (diff)
udevadm: accept command as option, like --help, --version
-rw-r--r--RELEASE-NOTES12
-rw-r--r--udevadm.c8
2 files changed, 14 insertions, 6 deletions
diff --git a/RELEASE-NOTES b/RELEASE-NOTES
index 6fadd2baf0..1b68833253 100644
--- a/RELEASE-NOTES
+++ b/RELEASE-NOTES
@@ -2,10 +2,14 @@ udev 117
========
Bugfixes.
-All udev tools are merged into a single binary called udevadm now.
-The old names of the binary are commands for udevadm now. Symlinks
-provide the functionality of the standalone tools. There is only a
-single udevadm.8 man page for all tools left.
+All udev tools are merged into a single binary called udevadm.
+The old names of the tools are built-in commands in udevadm now.
+Symlinks to udevadm, with the names of the old tools, provide
+the same functionality as the standalone tools. There is also
+only a single udevadm.8 man page left for all tools.
+
+Tools like mkinitramfs should be checked, if they need to include
+udevadm in the list of files.
udev 116
========
diff --git a/udevadm.c b/udevadm.c
index 24e4d991be..e2b7779a91 100644
--- a/udevadm.c
+++ b/udevadm.c
@@ -65,7 +65,7 @@ static int help(int argc, char *argv[], char *envp[])
{
const struct command *cmd;
- printf("Usage: udev COMMAND [OPTIONS]\n");
+ printf("Usage: udevadm COMMAND [OPTIONS]\n");
for (cmd = cmds; cmd->name != NULL; cmd++)
printf(" %-12s %s\n", cmd->name, cmd->help);
printf("\n");
@@ -145,9 +145,13 @@ int main(int argc, char *argv[], char *envp[])
argc--;
}
- if (command == NULL || command[0] == '\0')
+ if (command == NULL)
goto err_unknown;
+ /* allow command to be specified as an option */
+ if (strncmp(command, "--", 2) == 0)
+ command += 2;
+
/* find and execute command */
for (cmd = cmds; cmd->name != NULL; cmd++) {
if (strcmp(cmd->name, command) == 0) {