summaryrefslogtreecommitdiff
path: root/udev
diff options
context:
space:
mode:
authorKay Sievers <kay.sievers@vrfy.org>2008-10-02 16:49:05 +0200
committerKay Sievers <kay.sievers@vrfy.org>2008-10-02 16:49:05 +0200
commit033e9f8cde5a7feec1334888aec69def99c945b5 (patch)
treecdffede0d38c9fa8d80b93608d5c6e423547610a /udev
parent842dacb76f2f98537554683d7cccec4710779a8a (diff)
use no_argument, required_argument, optional_argument in longopts
Diffstat (limited to 'udev')
-rw-r--r--udev/lib/test-libudev.c12
-rw-r--r--udev/udevadm-control.c24
-rw-r--r--udev/udevadm-info.c22
-rw-r--r--udev/udevadm-monitor.c8
-rw-r--r--udev/udevadm-settle.c4
-rw-r--r--udev/udevadm-test.c8
-rw-r--r--udev/udevadm-trigger.c20
-rw-r--r--udev/udevadm.c6
-rw-r--r--udev/udevd.c10
9 files changed, 57 insertions, 57 deletions
diff --git a/udev/lib/test-libudev.c b/udev/lib/test-libudev.c
index 5d19d5dd75..47fbf3b42a 100644
--- a/udev/lib/test-libudev.c
+++ b/udev/lib/test-libudev.c
@@ -273,12 +273,12 @@ int main(int argc, char *argv[], char *envp[])
{
struct udev *udev = NULL;
static const struct option options[] = {
- { "syspath", 1, NULL, 'p' },
- { "subsystem", 1, NULL, 's' },
- { "socket", 1, NULL, 'S' },
- { "debug", 0, NULL, 'd' },
- { "help", 0, NULL, 'h' },
- { "version", 0, NULL, 'V' },
+ { "syspath", required_argument, NULL, 'p' },
+ { "subsystem", required_argument, NULL, 's' },
+ { "socket", required_argument, NULL, 'S' },
+ { "debug", no_argument, NULL, 'd' },
+ { "help", no_argument, NULL, 'h' },
+ { "version", no_argument, NULL, 'V' },
{}
};
struct udev_enumerate *udev_enumerate;
diff --git a/udev/udevadm-control.c b/udev/udevadm-control.c
index baffd0d204..50020b57d9 100644
--- a/udev/udevadm-control.c
+++ b/udev/udevadm-control.c
@@ -46,18 +46,18 @@ int udevadm_control(struct udev *udev, int argc, char *argv[])
/* compat values with '_' will be removed in a future release */
static const struct option options[] = {
- { "log-priority", 1, NULL, 'l' },
- { "log_priority", 1, NULL, 'l' + 256 },
- { "stop-exec-queue", 0, NULL, 's' },
- { "stop_exec_queue", 0, NULL, 's' + 256 },
- { "start-exec-queue", 0, NULL, 'S' },
- { "start_exec_queue", 0, NULL, 'S' + 256},
- { "reload-rules", 0, NULL, 'R' },
- { "reload_rules", 0, NULL, 'R' + 256},
- { "env", 1, NULL, 'e' },
- { "max-childs", 1, NULL, 'm' },
- { "max_childs", 1, NULL, 'm' + 256},
- { "help", 0, NULL, 'h' },
+ { "log-priority", required_argument, NULL, 'l' },
+ { "log_priority", required_argument, NULL, 'l' + 256 },
+ { "stop-exec-queue", no_argument, NULL, 's' },
+ { "stop_exec_queue", no_argument, NULL, 's' + 256 },
+ { "start-exec-queue", no_argument, NULL, 'S' },
+ { "start_exec_queue", no_argument, NULL, 'S' + 256},
+ { "reload-rules", no_argument, NULL, 'R' },
+ { "reload_rules", no_argument, NULL, 'R' + 256},
+ { "env", required_argument, NULL, 'e' },
+ { "max-childs", required_argument, NULL, 'm' },
+ { "max_childs", required_argument, NULL, 'm' + 256},
+ { "help", no_argument, NULL, 'h' },
{}
};
diff --git a/udev/udevadm-info.c b/udev/udevadm-info.c
index 4da9881dbe..ec098abd18 100644
--- a/udev/udevadm-info.c
+++ b/udev/udevadm-info.c
@@ -217,17 +217,17 @@ int udevadm_info(struct udev *udev, int argc, char *argv[])
int rc = 0;
static const struct option options[] = {
- { "name", 1, NULL, 'n' },
- { "path", 1, NULL, 'p' },
- { "query", 1, NULL, 'q' },
- { "attribute-walk", 0, NULL, 'a' },
- { "export-db", 0, NULL, 'e' },
- { "root", 0, NULL, 'r' },
- { "device-id-of-file", 1, NULL, 'd' },
- { "export", 0, NULL, 'x' },
- { "export-prefix", 1, NULL, 'P' },
- { "version", 0, NULL, 1 }, /* -V outputs braindead format */
- { "help", 0, NULL, 'h' },
+ { "name", required_argument, NULL, 'n' },
+ { "path", required_argument, NULL, 'p' },
+ { "query", required_argument, NULL, 'q' },
+ { "attribute-walk", no_argument, NULL, 'a' },
+ { "export-db", no_argument, NULL, 'e' },
+ { "root", no_argument, NULL, 'r' },
+ { "device-id-of-file", required_argument, NULL, 'd' },
+ { "export", no_argument, NULL, 'x' },
+ { "export-prefix", required_argument, NULL, 'P' },
+ { "version", no_argument, NULL, 1 }, /* -V outputs braindead format */
+ { "help", no_argument, NULL, 'h' },
{}
};
diff --git a/udev/udevadm-monitor.c b/udev/udevadm-monitor.c
index d5992ceb6c..14a6edc844 100644
--- a/udev/udevadm-monitor.c
+++ b/udev/udevadm-monitor.c
@@ -77,10 +77,10 @@ int udevadm_monitor(struct udev *udev, int argc, char *argv[])
int rc = 0;
static const struct option options[] = {
- { "environment", 0, NULL, 'e' },
- { "kernel", 0, NULL, 'k' },
- { "udev", 0, NULL, 'u' },
- { "help", 0, NULL, 'h' },
+ { "environment", no_argument, NULL, 'e' },
+ { "kernel", no_argument, NULL, 'k' },
+ { "udev", no_argument, NULL, 'u' },
+ { "help", no_argument, NULL, 'h' },
{}
};
diff --git a/udev/udevadm-settle.c b/udev/udevadm-settle.c
index d066ef90ce..5e5a080bc8 100644
--- a/udev/udevadm-settle.c
+++ b/udev/udevadm-settle.c
@@ -36,8 +36,8 @@
int udevadm_settle(struct udev *udev, int argc, char *argv[])
{
static const struct option options[] = {
- { "timeout", 1, NULL, 't' },
- { "help", 0, NULL, 'h' },
+ { "timeout", required_argument, NULL, 't' },
+ { "help", no_argument, NULL, 'h' },
{}
};
int timeout = DEFAULT_TIMEOUT;
diff --git a/udev/udevadm-test.c b/udev/udevadm-test.c
index ba0852871a..f4b0125d3c 100644
--- a/udev/udevadm-test.c
+++ b/udev/udevadm-test.c
@@ -83,10 +83,10 @@ int udevadm_test(struct udev *udev, int argc, char *argv[])
int rc = 0;
static const struct option options[] = {
- { "action", 1, NULL, 'a' },
- { "subsystem", 1, NULL, 's' },
- { "force", 0, NULL, 'f' },
- { "help", 0, NULL, 'h' },
+ { "action", required_argument, NULL, 'a' },
+ { "subsystem", required_argument, NULL, 's' },
+ { "force", no_argument, NULL, 'f' },
+ { "help", no_argument, NULL, 'h' },
{}
};
diff --git a/udev/udevadm-trigger.c b/udev/udevadm-trigger.c
index 8d25f92399..eb46a2983c 100644
--- a/udev/udevadm-trigger.c
+++ b/udev/udevadm-trigger.c
@@ -79,16 +79,16 @@ static int scan_failed(struct udev_enumerate *udev_enumerate)
int udevadm_trigger(struct udev *udev, int argc, char *argv[])
{
static const struct option options[] = {
- { "verbose", 0, NULL, 'v' },
- { "dry-run", 0, NULL, 'n' },
- { "type", 1, NULL, 't' },
- { "retry-failed", 0, NULL, 'F' },
- { "action", 1, NULL, 'c' },
- { "subsystem-match", 1, NULL, 's' },
- { "subsystem-nomatch", 1, NULL, 'S' },
- { "attr-match", 1, NULL, 'a' },
- { "attr-nomatch", 1, NULL, 'A' },
- { "help", 0, NULL, 'h' },
+ { "verbose", no_argument, NULL, 'v' },
+ { "dry-run", no_argument, NULL, 'n' },
+ { "type", required_argument, NULL, 't' },
+ { "retry-failed", no_argument, NULL, 'F' },
+ { "action", required_argument, NULL, 'c' },
+ { "subsystem-match", required_argument, NULL, 's' },
+ { "subsystem-nomatch", required_argument, NULL, 'S' },
+ { "attr-match", required_argument, NULL, 'a' },
+ { "attr-nomatch", required_argument, NULL, 'A' },
+ { "help", no_argument, NULL, 'h' },
{}
};
enum {
diff --git a/udev/udevadm.c b/udev/udevadm.c
index b18114273c..3f2c78212e 100644
--- a/udev/udevadm.c
+++ b/udev/udevadm.c
@@ -124,9 +124,9 @@ int main(int argc, char *argv[])
{
struct udev *udev;
static const struct option options[] = {
- { "debug", 0, NULL, 'd' },
- { "help", 0, NULL, 'h' },
- { "version", 0, NULL, 'V' },
+ { "debug", no_argument, NULL, 'd' },
+ { "help", no_argument, NULL, 'h' },
+ { "version", no_argument, NULL, 'V' },
{}
};
const char *command;
diff --git a/udev/udevd.c b/udev/udevd.c
index 9783fe4e7c..a821ee7d8e 100644
--- a/udev/udevd.c
+++ b/udev/udevd.c
@@ -784,11 +784,11 @@ int main(int argc, char *argv[])
const char *value;
int daemonize = 0;
static const struct option options[] = {
- { "daemon", 0, NULL, 'd' },
- { "debug-trace", 0, NULL, 't' },
- { "debug", 0, NULL, 'D' },
- { "help", 0, NULL, 'h' },
- { "version", 0, NULL, 'V' },
+ { "daemon", no_argument, NULL, 'd' },
+ { "debug-trace", no_argument, NULL, 't' },
+ { "debug", no_argument, NULL, 'D' },
+ { "help", no_argument, NULL, 'h' },
+ { "version", no_argument, NULL, 'V' },
{}
};
int rc = 1;