summaryrefslogtreecommitdiff
path: root/tools/bpf/bpftool/bash-completion
diff options
context:
space:
mode:
Diffstat (limited to 'tools/bpf/bpftool/bash-completion')
-rw-r--r--tools/bpf/bpftool/bash-completion/bpftool17
1 files changed, 10 insertions, 7 deletions
diff --git a/tools/bpf/bpftool/bash-completion/bpftool b/tools/bpf/bpftool/bash-completion/bpftool
index a3cb07172789..69c64dc18b1d 100644
--- a/tools/bpf/bpftool/bash-completion/bpftool
+++ b/tools/bpf/bpftool/bash-completion/bpftool
@@ -271,7 +271,7 @@ _bpftool()
# Deal with simplest keywords
case $prev in
- help|hex|opcodes|visual|linum)
+ help|hex)
return 0
;;
tag)
@@ -369,13 +369,16 @@ _bpftool()
return 0
;;
*)
- _bpftool_once_attr 'file'
+ # "file" is not compatible with other keywords here
+ if _bpftool_search_list 'file'; then
+ return 0
+ fi
+ if ! _bpftool_search_list 'linum opcodes visual'; then
+ _bpftool_once_attr 'file'
+ fi
+ _bpftool_once_attr 'linum opcodes'
if _bpftool_search_list 'xlated' && [[ "$json" == 0 ]]; then
- COMPREPLY+=( $( compgen -W 'opcodes visual linum' -- \
- "$cur" ) )
- else
- COMPREPLY+=( $( compgen -W 'opcodes linum' -- \
- "$cur" ) )
+ _bpftool_once_attr 'visual'
fi
return 0
;;