[PATCH bpf-next v2 1/2] bpftool: Add HELP_SPEC_OPTIONS in token.c

From: Tao Chen

Date: Tue Sep 16 2025 - 23:48:43 EST


$ ./bpftool token help

Usage: bpftool token { show | list }
bpftool token help
OPTIONS := { {-j|--json} [{-p|--pretty}] | {-d|--debug} }

Fixes: 2d812311c2b2 ("bpftool: Add bpf_token show")
Acked-by: Quentin Monnet <qmo@xxxxxxxxxx>
Signed-off-by: Tao Chen <chen.dylane@xxxxxxxxx>
---
tools/bpf/bpftool/token.c | 1 +
1 file changed, 1 insertion(+)

Change list:
v1 -> v2:
- strdup(mntent->mnt_opts) once per cmd/map/prog and
remove another strdrup/free in print_items_per_line
in patch2.(Alexei)
v1: https://lore.kernel.org/bpf/20250916054111.1151487-1-chen.dylane@xxxxxxxxx

diff --git a/tools/bpf/bpftool/token.c b/tools/bpf/bpftool/token.c
index 6312e662a12..82b829e44c8 100644
--- a/tools/bpf/bpftool/token.c
+++ b/tools/bpf/bpftool/token.c
@@ -206,6 +206,7 @@ static int do_help(int argc, char **argv)
fprintf(stderr,
"Usage: %1$s %2$s { show | list }\n"
" %1$s %2$s help\n"
+ " " HELP_SPEC_OPTIONS " }\n"
"\n"
"",
bin_name, argv[-2]);
--
2.48.1