Netdev List
 help / color / mirror / Atom feed
From: Dmitri Seletski <drjoms@gmail.com>
To: netdev@vger.kernel.org
Subject: [PATCH iproute2-next] "ip help" wrong output, exit code.
Date: Sun, 21 Jun 2026 22:56:27 +0100	[thread overview]
Message-ID: <ca8680ae-82b4-4d63-823e-d9e808b29f51@gmail.com> (raw)

Changed output of "ip help" from standard error to standard output. And 
Exit is now 0 instead of -1. "ip help|grep bridge" - now gives bridge 
syntax instead of flooding user with everything from "ip help".
---
ip/ip.c | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/ip/ip.c b/ip/ip.c
index e4b71bde..4627b61c 100644
--- a/ip/ip.c
+++ b/ip/ip.c
@@ -56,7 +56,7 @@ static void usage(void) __attribute__((noreturn));

static void usage(void)
{
-fprintf(stderr,
+fprintf(stdout,
"Usage: ip [ OPTIONS ] OBJECT { COMMAND | help }\n"
"       ip [ -force ] -batch filename\n"
"where  OBJECT := { address | addrlabel | fou | help | ila | ioam | l2tp 
| link |\n"
@@ -72,7 +72,7 @@ static void usage(void)
"                    -o[neline] | -t[imestamp] | -ts[hort] | -b[atch] 
[filename] |\n"
"                    -rc[vbuf] [size] | -n[etns] name | -N[umeric] | 
-a[ll] |\n"
"                    -c[olor]}\n");
-exit(-1);
+exit(0);
}

static int do_help(int argc, char **argv)
-- 
2.53.0



                 reply	other threads:[~2026-06-21 21:56 UTC|newest]

Thread overview: [no followups] expand[flat|nested]  mbox.gz  Atom feed

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=ca8680ae-82b4-4d63-823e-d9e808b29f51@gmail.com \
    --to=drjoms@gmail.com \
    --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