From 7643ac9a8add1f07ffc237c054feb443b5612717 Mon Sep 17 00:00:00 2001 From: Zbigniew Jędrzejewski-Szmek Date: Tue, 17 Dec 2013 21:48:14 -0500 Subject: udevadm,scsi_id: add short options to help strings and to the man page Also clean things up a bit here and there. --- src/udev/udevadm-test-builtin.c | 17 +++++------------ 1 file changed, 5 insertions(+), 12 deletions(-) (limited to 'src/udev/udevadm-test-builtin.c') diff --git a/src/udev/udevadm-test-builtin.c b/src/udev/udevadm-test-builtin.c index f4aa21ee72..80418783ff 100644 --- a/src/udev/udevadm-test-builtin.c +++ b/src/udev/udevadm-test-builtin.c @@ -37,7 +37,7 @@ static void help(struct udev *udev) { fprintf(stderr, "\n"); - fprintf(stderr, "Usage: udevadm builtin [--help] \n"); + fprintf(stderr, "Usage: udevadm builtin [--help] COMMAND SYSPATH\n"); udev_builtin_list(udev); fprintf(stderr, "\n"); } @@ -53,21 +53,14 @@ static int adm_builtin(struct udev *udev, int argc, char *argv[]) char filename[UTIL_PATH_SIZE]; struct udev_device *dev = NULL; enum udev_builtin_cmd cmd; - int rc = EXIT_SUCCESS; + int rc = EXIT_SUCCESS, c; - for (;;) { - int option; - - option = getopt_long(argc, argv, "h", options, NULL); - if (option == -1) - break; - - switch (option) { + while ((c = getopt_long(argc, argv, "h", options, NULL)) >= 0) + switch (c) { case 'h': help(udev); goto out; } - } command = argv[optind++]; if (command == NULL) { @@ -79,7 +72,7 @@ static int adm_builtin(struct udev *udev, int argc, char *argv[]) syspath = argv[optind++]; if (syspath == NULL) { - fprintf(stderr, "syspath missing\n\n"); + fprintf(stderr, "syspath missing\n"); rc = 3; goto out; } -- cgit v1.2.3-54-g00ecf