瀏覽代碼

tools: bpftool: add bash completion for `bpftool prog load`

Add bash completion for bpftool command `prog load`. Completion for this
command is easy, as it only takes existing file paths as arguments.

Fixes: 49a086c201a9 ("bpftool: implement prog load command")
Signed-off-by: Quentin Monnet <quentin.monnet@netronome.com>
Reviewed-by: Jakub Kicinski <jakub.kicinski@netronome.com>
Signed-off-by: Daniel Borkmann <daniel@iogearbox.net>
Quentin Monnet 7 年之前
父節點
當前提交
55f3538c49
共有 1 個文件被更改,包括 6 次插入2 次删除
  1. 6 2
      tools/bpf/bpftool/bash-completion/bpftool

+ 6 - 2
tools/bpf/bpftool/bash-completion/bpftool

@@ -230,10 +230,14 @@ _bpftool()
                     fi
                     fi
                     return 0
                     return 0
                     ;;
                     ;;
+                load)
+                    _filedir
+                    return 0
+                    ;;
                 *)
                 *)
                     [[ $prev == $object ]] && \
                     [[ $prev == $object ]] && \
-                        COMPREPLY=( $( compgen -W 'dump help pin show list' -- \
-                            "$cur" ) )
+                        COMPREPLY=( $( compgen -W 'dump help pin load \
+                            show list' -- "$cur" ) )
                     ;;
                     ;;
             esac
             esac
             ;;
             ;;