Blob Blame History Raw
From: Quentin Monnet <quentin.monnet@netronome.com>
Date: Thu, 19 Oct 2017 15:46:22 -0700
Subject: tools: bpftool: add `bpftool prog help` as real command i.r.t exit
 code
Patch-mainline: v4.15-rc1
Git-commit: 9f606179c84930ada1e347b6d84bb913c8492fec
References: bsc#1109837

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>
Acked-by: Daniel Borkmann <daniel@iogearbox.net>
Signed-off-by: David S. Miller <davem@davemloft.net>
Acked-by: Thomas Bogendoerfer <tbogendoerfer@suse.de>
---
 tools/bpf/bpftool/prog.c |    1 +
 1 file changed, 1 insertion(+)

--- 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 }