]> sourceware.org Git - lvm2.git/commitdiff
commands: compensate --uuid
authorZdenek Kabelac <zkabelac@redhat.com>
Fri, 17 Feb 2017 12:57:59 +0000 (13:57 +0100)
committerZdenek Kabelac <zkabelac@redhat.com>
Fri, 17 Feb 2017 12:57:59 +0000 (13:57 +0100)
As we now user binary search - it's nondeterministict
which of the same 'args' will be give - so duplicates
need 'extra' care.

So provide same hack for output for --uuidstr_ARG as
for input.

Solves 'pvscan -u'.

tools/command.c

index 1abac20c5bbe2cb37f756e3297638e1cc96a17b1..6cd4d684a952f841d907e332a4478e0f2e1822ae 100644 (file)
@@ -866,6 +866,11 @@ static void add_opt_arg(struct command *cmd, char *str, int *takes_arg, int requ
        }
 
        opt = opt_str_to_num(cmd, str);
+
+       /* If the binary-search finds uuidstr_ARG switch to uuid_ARG */
+       if (opt == uuidstr_ARG)
+               opt = uuid_ARG;
+
 skip:
        if (required > 0)
                cmd->required_opt_args[cmd->ro_count++].opt = opt;
This page took 0.038234 seconds and 5 git commands to generate.