]> git.ipfire.org Git - thirdparty/iproute2.git/commitdiff
bridge: reorder cmd line arg parsing to let "-c" detected as "color" option
authorGokul Sivakumar <gokulkumar792@gmail.com>
Tue, 17 Aug 2021 17:28:05 +0000 (22:58 +0530)
committerStephen Hemminger <stephen@networkplumber.org>
Wed, 18 Aug 2021 21:04:53 +0000 (14:04 -0700)
As per the man/man8/bridge.8 page, the shorthand cmd line arg "-c" can be
used to colorize the bridge cmd output. But while parsing the args in while
loop, matches() detects "-c" as "-compressedvlans" instead of "-color", so
fix this by doing the check for "-color" option first before checking for
"-compressedvlans".

Signed-off-by: Gokul Sivakumar <gokulkumar792@gmail.com>
Signed-off-by: Stephen Hemminger <stephen@networkplumber.org>
bridge/bridge.c

index f7bfe0b569d33db08c1157e572b9d52aa5b95ebe..48b0e7f846f633cee0be84b287320177483ebfc4 100644 (file)
@@ -149,9 +149,9 @@ main(int argc, char **argv)
                        NEXT_ARG();
                        if (netns_switch(argv[1]))
                                exit(-1);
+               } else if (matches_color(opt, &color)) {
                } else if (matches(opt, "-compressvlans") == 0) {
                        ++compress_vlans;
-               } else if (matches_color(opt, &color)) {
                } else if (matches(opt, "-force") == 0) {
                        ++force;
                } else if (matches(opt, "-json") == 0) {