netdev.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Gokul Sivakumar <gokulkumar792@gmail.com>
To: David Ahern <dsahern@gmail.com>,
	netdev@vger.kernel.org, David Ahern <dsahern@kernel.org>,
	Stephen Hemminger <stephen@networkplumber.org>
Subject: Re: [PATCH iproute2-next v2 1/3] bridge: reorder cmd line arg parsing to let "-c" detected as "color" option
Date: Tue, 17 Aug 2021 22:47:18 +0530	[thread overview]
Message-ID: <0a6f29cb5d3240bc880e48a88f1b603e1f081c3a.camel@gmail.com> (raw)
In-Reply-To: <97b96fce-29a0-b9ab-1049-33d50de912a7@gmail.com>

On Tue, 2021-08-17 at 09:11 -0600, David Ahern wrote:
> On 8/14/21 12:47 PM, Gokul Sivakumar wrote:
> > 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>
> > ---
> >  bridge/bridge.c | 2 +-
> >  1 file changed, 1 insertion(+), 1 deletion(-)
> > 
> > diff --git a/bridge/bridge.c b/bridge/bridge.c
> > index f7bfe0b5..48b0e7f8 100644
> > --- a/bridge/bridge.c
> > +++ b/bridge/bridge.c
> > @@ -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) {
> > 
> 
> Another example of why matches needs to be deprecated.
> 
> Re-assigned the set to Stephen for main tree.

Thanks, i will send a v3 patchset with the subject prefix "PATCH iproute2"
instead of "PATCH iproute2-next" after addressing Stephen's recent suggestion 
to remove the unnecessary is_json_context() condition checks from patch 2/3.

Gokul


  reply	other threads:[~2021-08-17 17:17 UTC|newest]

Thread overview: 8+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-08-14 18:47 [PATCH iproute2-next v2 0/3] bridge: fixes regarding the colorized output Gokul Sivakumar
2021-08-14 18:47 ` [PATCH iproute2-next v2 1/3] bridge: reorder cmd line arg parsing to let "-c" detected as "color" option Gokul Sivakumar
2021-08-17 15:11   ` David Ahern
2021-08-17 17:17     ` Gokul Sivakumar [this message]
2021-08-14 18:47 ` [PATCH iproute2-next v2 2/3] bridge: fdb: don't colorize the "dev" & "dst" keywords in "bridge -c fdb" Gokul Sivakumar
2021-08-17 15:27   ` Stephen Hemminger
2021-08-17 17:22     ` Gokul Sivakumar
2021-08-14 18:47 ` [PATCH iproute2-next v2 3/3] man: bridge: fix the typo to change "-c[lor]" into "-c[olor]" in man page Gokul Sivakumar

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=0a6f29cb5d3240bc880e48a88f1b603e1f081c3a.camel@gmail.com \
    --to=gokulkumar792@gmail.com \
    --cc=dsahern@gmail.com \
    --cc=dsahern@kernel.org \
    --cc=netdev@vger.kernel.org \
    --cc=stephen@networkplumber.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).