diff options
author | Kay Sievers <kay.sievers@vrfy.org> | 2009-06-10 15:55:24 +0200 |
---|---|---|
committer | Kay Sievers <kay.sievers@vrfy.org> | 2009-06-10 15:55:24 +0200 |
commit | ff5d99e0b04d1e49204be60ac5641b01f89c34ac (patch) | |
tree | 8a55c38275cc0d9d955d740a8ab76bd009fb5a57 /udev/udevadm-info.c | |
parent | 20fa0fd6a002d6bf1eb1c180515c0fed336ac0b2 (diff) |
udevadm: info -revert "accept --query without argument"
Getopt is too dumb, the optional argument breaks "udevadm -q symlink".
Diffstat (limited to 'udev/udevadm-info.c')
-rw-r--r-- | udev/udevadm-info.c | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/udev/udevadm-info.c b/udev/udevadm-info.c index 2ffce27ed7..fa09b98299 100644 --- a/udev/udevadm-info.c +++ b/udev/udevadm-info.c @@ -221,7 +221,7 @@ int udevadm_info(struct udev *udev, int argc, char *argv[]) static const struct option options[] = { { "name", required_argument, NULL, 'n' }, { "path", required_argument, NULL, 'p' }, - { "query", optional_argument, NULL, 'q' }, + { "query", required_argument, NULL, 'q' }, { "attribute-walk", no_argument, NULL, 'a' }, { "export-db", no_argument, NULL, 'e' }, { "root", no_argument, NULL, 'r' }, @@ -254,7 +254,7 @@ int udevadm_info(struct udev *udev, int argc, char *argv[]) int option; struct stat statbuf; - option = getopt_long(argc, argv, "aed:n:p:q::rxPVh", options, NULL); + option = getopt_long(argc, argv, "aed:n:p:q:rxPVh", options, NULL); if (option == -1) break; @@ -317,7 +317,7 @@ int udevadm_info(struct udev *udev, int argc, char *argv[]) break; case 'q': action = ACTION_QUERY; - if (optarg == NULL || strcmp(optarg, "property") == 0 || strcmp(optarg, "env") == 0) { + if (strcmp(optarg, "property") == 0 || strcmp(optarg, "env") == 0) { query = QUERY_PROPERTY; } else if (strcmp(optarg, "name") == 0) { query = QUERY_NAME; |