netdev.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Vadim Kochan <vadim4j@gmail.com>
To: netdev@vger.kernel.org
Cc: leonhard@pre.is, Vadim Kochan <vadim4j@gmail.com>
Subject: [PATCH iproute2] ip link: Do not show help if 'dev he' was specified
Date: Sun, 15 Mar 2015 10:01:55 +0200	[thread overview]
Message-ID: <1426406515-16171-1-git-send-email-vadim4j@gmail.com> (raw)

From: Vadim Kochan <vadim4j@gmail.com>

Date: Sun, 15 Mar 2015 09:11:41 +0200
Signed-off-by: Vadim Kochan <vadim4j@gmail.com>
Reported-by: Leonhard Preis <leonhard@pre.is>
---
 ip/ipaddress.c | 3 +--
 ip/iplink.c    | 6 ++----
 2 files changed, 3 insertions(+), 6 deletions(-)

diff --git a/ip/ipaddress.c b/ip/ipaddress.c
index 99a6ab5..4879826 100644
--- a/ip/ipaddress.c
+++ b/ip/ipaddress.c
@@ -1380,8 +1380,7 @@ static int ipaddr_list_flush_or_save(int argc, char **argv, int action)
 		} else {
 			if (strcmp(*argv, "dev") == 0) {
 				NEXT_ARG();
-			}
-			if (matches(*argv, "help") == 0)
+			} else if (matches(*argv, "help") == 0)
 				usage();
 			if (filter_dev)
 				duparg2("dev", *argv);
diff --git a/ip/iplink.c b/ip/iplink.c
index 5893ee4..664774f 100644
--- a/ip/iplink.c
+++ b/ip/iplink.c
@@ -601,8 +601,7 @@ int iplink_parse(int argc, char **argv, struct iplink_req *req,
 		} else {
 			if (strcmp(*argv, "dev") == 0) {
 				NEXT_ARG();
-			}
-			if (matches(*argv, "help") == 0)
+			} else if (matches(*argv, "help") == 0)
 				usage();
 			if (*dev)
 				duparg2("dev", *argv);
@@ -1088,8 +1087,7 @@ static int do_set(int argc, char **argv)
 		} else {
 			if (strcmp(*argv, "dev") == 0) {
 				NEXT_ARG();
-			}
-			if (matches(*argv, "help") == 0)
+			} else if (matches(*argv, "help") == 0)
 				usage();
 			if (dev)
 				duparg2("dev", *argv);
-- 
2.3.1

             reply	other threads:[~2015-03-15  8:13 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2015-03-15  8:01 Vadim Kochan [this message]
2015-03-15 10:24 ` [PATCH iproute2] ip link: Do not show help if 'dev he' was specified Christoph Schulz
2015-03-15 10:38   ` Vadim Kochan
2015-03-15 11:42     ` Christoph Schulz
2015-03-15 11:35       ` Vadim Kochan

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=1426406515-16171-1-git-send-email-vadim4j@gmail.com \
    --to=vadim4j@gmail.com \
    --cc=leonhard@pre.is \
    --cc=netdev@vger.kernel.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).