netdev.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Jakub Kicinski <jakub.kicinski@netronome.com>
To: netdev@vger.kernel.org
Cc: oss-drivers@netronome.com,
	Quentin Monnet <quentin.monnet@netronome.com>,
	Jakub Kicinski <jakub.kicinski@netronome.com>
Subject: [PATCH net-next 4/8] tools: bpftool: add `bpftool prog help` as real command i.r.t exit code
Date: Thu, 19 Oct 2017 15:46:22 -0700	[thread overview]
Message-ID: <20171019224626.31608-5-jakub.kicinski@netronome.com> (raw)
In-Reply-To: <20171019224626.31608-1-jakub.kicinski@netronome.com>

From: Quentin Monnet <quentin.monnet@netronome.com>

Make error messages and return codes more consistent. Specifically, make
`bpftool prog help` a real command, instead of printing usage by default
for a non-recognized "help" command. Output is the same, but this makes
bpftool return with a success value instead of an error.

Signed-off-by: Quentin Monnet <quentin.monnet@netronome.com>
Signed-off-by: Jakub Kicinski <jakub.kicinski@netronome.com>
---
 tools/bpf/bpftool/prog.c | 1 +
 1 file changed, 1 insertion(+)

diff --git a/tools/bpf/bpftool/prog.c b/tools/bpf/bpftool/prog.c
index 6c03d2ea3f79..355c14325622 100644
--- a/tools/bpf/bpftool/prog.c
+++ b/tools/bpf/bpftool/prog.c
@@ -475,6 +475,7 @@ static int do_help(int argc, char **argv)
 
 static const struct cmd cmds[] = {
 	{ "show",	do_show },
+	{ "help",	do_help },
 	{ "dump",	do_dump },
 	{ "pin",	do_pin },
 	{ 0 }
-- 
2.14.1

  parent reply	other threads:[~2017-10-19 22:47 UTC|newest]

Thread overview: 23+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2017-10-19 22:46 [PATCH net-next 0/8] tools: bpftool: add a "version" command, and fix several items Jakub Kicinski
2017-10-19 22:46 ` [PATCH net-next 1/8] tools: bpftool: add pointer to file argument to print_hex() Jakub Kicinski
2017-10-20 10:55   ` Daniel Borkmann
2017-10-19 22:46 ` [PATCH net-next 2/8] tools: bpftool: fix return value when all eBPF programs have been shown Jakub Kicinski
2017-10-20 10:55   ` Daniel Borkmann
2017-10-19 22:46 ` [PATCH net-next 3/8] tools: bpftool: use err() instead of info() if there are too many insns Jakub Kicinski
2017-10-20 10:55   ` Daniel Borkmann
2017-10-19 22:46 ` Jakub Kicinski [this message]
2017-10-20 10:56   ` [PATCH net-next 4/8] tools: bpftool: add `bpftool prog help` as real command i.r.t exit code Daniel Borkmann
2017-10-19 22:46 ` [PATCH net-next 5/8] tools: bpftool: print only one error message on byte parsing failure Jakub Kicinski
2017-10-20 10:56   ` Daniel Borkmann
2017-10-19 22:46 ` [PATCH net-next 6/8] tools: bpftool: print all relevant byte opcodes for "load double word" Jakub Kicinski
2017-10-20  9:59   ` David Laight
2017-10-20 15:50     ` Quentin Monnet
2017-10-20 16:12       ` Daniel Borkmann
2017-10-20 16:41         ` Quentin Monnet
2017-10-20 10:56   ` Daniel Borkmann
2017-10-19 22:46 ` [PATCH net-next 7/8] tools: bpftool: show that `opcodes` or `file FILE` should be exclusive Jakub Kicinski
2017-10-20 10:56   ` Daniel Borkmann
2017-10-19 22:46 ` [PATCH net-next 8/8] tools: bpftool: add a command to display bpftool version Jakub Kicinski
2017-10-20 10:57   ` Daniel Borkmann
2017-10-19 23:42 ` [PATCH net-next 0/8] tools: bpftool: add a "version" command, and fix several items Alexei Starovoitov
2017-10-22  1:11 ` David Miller

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=20171019224626.31608-5-jakub.kicinski@netronome.com \
    --to=jakub.kicinski@netronome.com \
    --cc=netdev@vger.kernel.org \
    --cc=oss-drivers@netronome.com \
    --cc=quentin.monnet@netronome.com \
    /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).