qemu-io: use no_argument/required_argument constants

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 <eblake@redhat.com>
Signed-off-by: Daniel P. Berrange <berrange@redhat.com>
Signed-off-by: Kevin Wolf <kwolf@redhat.com>
This commit is contained in:
Daniel P. Berrange 2016-02-17 10:10:23 +00:00 committed by Kevin Wolf
parent aa6e546c5a
commit a513416ecf

View File

@ -407,21 +407,21 @@ int main(int argc, char **argv)
int readonly = 0; int readonly = 0;
const char *sopt = "hVc:d:f:rsnmgkt:T:"; const char *sopt = "hVc:d:f:rsnmgkt:T:";
const struct option lopt[] = { const struct option lopt[] = {
{ "help", 0, NULL, 'h' }, { "help", no_argument, NULL, 'h' },
{ "version", 0, NULL, 'V' }, { "version", no_argument, NULL, 'V' },
{ "offset", 1, NULL, 'o' }, { "offset", required_argument, NULL, 'o' },
{ "cmd", 1, NULL, 'c' }, { "cmd", required_argument, NULL, 'c' },
{ "format", 1, NULL, 'f' }, { "format", required_argument, NULL, 'f' },
{ "read-only", 0, NULL, 'r' }, { "read-only", no_argument, NULL, 'r' },
{ "snapshot", 0, NULL, 's' }, { "snapshot", no_argument, NULL, 's' },
{ "nocache", 0, NULL, 'n' }, { "nocache", no_argument, NULL, 'n' },
{ "misalign", 0, NULL, 'm' }, { "misalign", no_argument, NULL, 'm' },
{ "native-aio", 0, NULL, 'k' }, { "native-aio", no_argument, NULL, 'k' },
{ "discard", 1, NULL, 'd' }, { "discard", required_argument, NULL, 'd' },
{ "cache", 1, NULL, 't' }, { "cache", required_argument, NULL, 't' },
{ "trace", 1, NULL, 'T' }, { "trace", required_argument, NULL, 'T' },
{ "object", 1, NULL, OPTION_OBJECT }, { "object", required_argument, NULL, OPTION_OBJECT },
{ "image-opts", 0, NULL, OPTION_IMAGE_OPTS }, { "image-opts", no_argument, NULL, OPTION_IMAGE_OPTS },
{ NULL, 0, NULL, 0 } { NULL, 0, NULL, 0 }
}; };
int c; int c;