@@ -639,10 +639,24 @@ _bpftool()
return 0
;;
*)
- if [[ $cword == 6 ]] && [[ ${words[3]} == "map" ]]; then
- COMPREPLY+=( $( compgen -W 'key value kv all' -- \
- "$cur" ) )
- fi
+ # emit extra options
+ case ${words[3]} in
+ id|file)
+ if [[ $cword > 4 ]]; then
+ _bpftool_once_attr 'c'
+ fi
+ ;;
+ map|prog)
+ if [[ ${words[3]} == "map" ]] && [[ $cword == 6 ]]; then
+ COMPREPLY+=( $( compgen -W "key value kv all" -- "$cur" ) )
+ fi
+ if [[ $cword > 5 ]]; then
+ _bpftool_once_attr 'c'
+ fi
+ ;;
+ *)
+ ;;
+ esac
return 0
;;
esac
Add bash completion for new C btf dump option. Signed-off-by: Andrii Nakryiko <andriin@fb.com> --- tools/bpf/bpftool/bash-completion/bpftool | 22 ++++++++++++++++++---- 1 file changed, 18 insertions(+), 4 deletions(-)