[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Qemu-devel] [PATCH v3 10/10] qemu-io: use no_argument/required_argument
From: |
Daniel P. Berrange |
Subject: |
[Qemu-devel] [PATCH v3 10/10] qemu-io: use no_argument/required_argument constants |
Date: |
Tue, 19 Jan 2016 10:37:12 +0000 |
When declaring the 'struct option' array, use the standard
constants no_argument/required_argument, instead of magic
values 0 and 1.
Reviewed-by: Eric Blake <address@hidden>
Signed-off-by: Daniel P. Berrange <address@hidden>
---
qemu-io.c | 30 +++++++++++++++---------------
1 file changed, 15 insertions(+), 15 deletions(-)
diff --git a/qemu-io.c b/qemu-io.c
index dceaaa9..1c20e9b 100644
--- a/qemu-io.c
+++ b/qemu-io.c
@@ -416,21 +416,21 @@ int main(int argc, char **argv)
int readonly = 0;
const char *sopt = "hVc:d:f:rsnmgkt:T:";
const struct option lopt[] = {
- { "help", 0, NULL, 'h' },
- { "version", 0, NULL, 'V' },
- { "offset", 1, NULL, 'o' },
- { "cmd", 1, NULL, 'c' },
- { "format", 1, NULL, 'f' },
- { "read-only", 0, NULL, 'r' },
- { "snapshot", 0, NULL, 's' },
- { "nocache", 0, NULL, 'n' },
- { "misalign", 0, NULL, 'm' },
- { "native-aio", 0, NULL, 'k' },
- { "discard", 1, NULL, 'd' },
- { "cache", 1, NULL, 't' },
- { "trace", 1, NULL, 'T' },
- { "object", 1, NULL, OPTION_OBJECT },
- { "image-opts", 0, NULL, OPTION_IMAGE_OPTS },
+ { "help", no_argument, NULL, 'h' },
+ { "version", no_argument, NULL, 'V' },
+ { "offset", required_argument, NULL, 'o' },
+ { "cmd", required_argument, NULL, 'c' },
+ { "format", required_argument, NULL, 'f' },
+ { "read-only", no_argument, NULL, 'r' },
+ { "snapshot", no_argument, NULL, 's' },
+ { "nocache", no_argument, NULL, 'n' },
+ { "misalign", no_argument, NULL, 'm' },
+ { "native-aio", no_argument, NULL, 'k' },
+ { "discard", required_argument, NULL, 'd' },
+ { "cache", required_argument, NULL, 't' },
+ { "trace", required_argument, NULL, 'T' },
+ { "object", required_argument, NULL, OPTION_OBJECT },
+ { "image-opts", no_argument, NULL, OPTION_IMAGE_OPTS },
{ NULL, 0, NULL, 0 }
};
int c;
--
2.5.0
- [Qemu-devel] [PATCH v3 00/10] Make qemu-img/qemu-nbd/qemu-io CLI more flexible, Daniel P. Berrange, 2016/01/19
- [Qemu-devel] [PATCH v3 01/10] qom: add helpers for UserCreatable object types, Daniel P. Berrange, 2016/01/19
- [Qemu-devel] [PATCH v3 04/10] qemu-io: add support for --object command line arg, Daniel P. Berrange, 2016/01/19
- [Qemu-devel] [PATCH v3 03/10] qemu-nbd: add support for --object command line arg, Daniel P. Berrange, 2016/01/19
- [Qemu-devel] [PATCH v3 02/10] qemu-img: add support for --object command line arg, Daniel P. Berrange, 2016/01/19
- [Qemu-devel] [PATCH v3 05/10] qemu-io: allow specifying image as a set of options args, Daniel P. Berrange, 2016/01/19
- [Qemu-devel] [PATCH v3 06/10] qemu-nbd: allow specifying image as a set of options args, Daniel P. Berrange, 2016/01/19
- [Qemu-devel] [PATCH v3 10/10] qemu-io: use no_argument/required_argument constants,
Daniel P. Berrange <=
- [Qemu-devel] [PATCH v3 09/10] qemu-nbd: use no_argument/required_argument constants, Daniel P. Berrange, 2016/01/19
- [Qemu-devel] [PATCH v3 08/10] qemu-nbd: don't overlap long option values with short options, Daniel P. Berrange, 2016/01/19
- [Qemu-devel] [PATCH v3 07/10] qemu-img: allow specifying image as a set of options args, Daniel P. Berrange, 2016/01/19