diff options
author | Quentin Monnet <quentin@isovalent.com> | 2022-07-01 11:38:05 +0200 |
---|---|---|
committer | Daniel Borkmann <daniel@iogearbox.net> | 2022-07-05 11:53:54 +0200 |
commit | 990a6194f7e16cc23334892287f32899e241b1a9 (patch) | |
tree | 5bce7c439af48639054db6c51038e460ed42888c /tools/bpf/bpftool/bash-completion | |
parent | bpf: Omit superfluous address family check in __bpf_skc_lookup (diff) | |
download | linux-990a6194f7e16cc23334892287f32899e241b1a9.tar.xz linux-990a6194f7e16cc23334892287f32899e241b1a9.zip |
bpftool: Rename "bpftool feature list" into "... feature list_builtins"
To make it more explicit that the features listed with "bpftool feature
list" are known to bpftool, but not necessary available on the system
(as opposed to the probed features), rename the "feature list" command
into "feature list_builtins".
Note that "bpftool feature list" still works as before given that we
recognise arguments from their prefixes; but the real name of the
subcommand, in particular as displayed in the man page or the
interactive help, will now include "_builtins".
Since we update the bash completion accordingly, let's also take this
chance to redirect error output to /dev/null in the completion script,
to avoid displaying unexpected error messages when users attempt to
tab-complete.
Suggested-by: Daniel Borkmann <daniel@iogearbox.net>
Signed-off-by: Quentin Monnet <quentin@isovalent.com>
Signed-off-by: Daniel Borkmann <daniel@iogearbox.net>
Acked-by: Yonghong Song <yhs@fb.com>
Link: https://lore.kernel.org/bpf/20220701093805.16920-1-quentin@isovalent.com
Diffstat (limited to 'tools/bpf/bpftool/bash-completion')
-rw-r--r-- | tools/bpf/bpftool/bash-completion/bpftool | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/tools/bpf/bpftool/bash-completion/bpftool b/tools/bpf/bpftool/bash-completion/bpftool index ee177f83b179..dc1641e3670e 100644 --- a/tools/bpf/bpftool/bash-completion/bpftool +++ b/tools/bpf/bpftool/bash-completion/bpftool @@ -703,7 +703,7 @@ _bpftool() return 0 ;; type) - local BPFTOOL_MAP_CREATE_TYPES="$(bpftool feature list map_types | \ + local BPFTOOL_MAP_CREATE_TYPES="$(bpftool feature list_builtins map_types 2>/dev/null | \ grep -v '^unspec$')" COMPREPLY=( $( compgen -W "$BPFTOOL_MAP_CREATE_TYPES" -- "$cur" ) ) return 0 @@ -1032,7 +1032,7 @@ _bpftool() return 0 ;; attach|detach) - local BPFTOOL_CGROUP_ATTACH_TYPES="$(bpftool feature list attach_types | \ + local BPFTOOL_CGROUP_ATTACH_TYPES="$(bpftool feature list_builtins attach_types 2>/dev/null | \ grep '^cgroup_')" local ATTACH_FLAGS='multi override' local PROG_TYPE='id pinned tag name' @@ -1162,14 +1162,14 @@ _bpftool() _bpftool_once_attr 'full unprivileged' return 0 ;; - list) + list_builtins) [[ $prev != "$command" ]] && return 0 COMPREPLY=( $( compgen -W 'prog_types map_types \ attach_types link_types helpers' -- "$cur" ) ) ;; *) [[ $prev == $object ]] && \ - COMPREPLY=( $( compgen -W 'help list probe' -- "$cur" ) ) + COMPREPLY=( $( compgen -W 'help list_builtins probe' -- "$cur" ) ) ;; esac ;; |