Subcommand list are now dynamic in bash completion

This commit is contained in:
Victor LABORIE 2019-01-07 17:52:19 +01:00
parent cda35bba6e
commit 4db5dcac03
1 changed files with 1 additions and 1 deletions

View File

@ -9,7 +9,7 @@ function _bkctld()
cur=${COMP_WORDS[COMP_CWORD]};
prev=${COMP_WORDS[COMP_CWORD-1]};
commands="init update remove start stop reload restart sync status key port ip inc rm check stats"
commands=$(find /usr/lib/bkctld/ -name "bkctld-*" -exec basename {} \;|sed 's/^bkctld-//')
if [ $COMP_CWORD -eq 1 ]; then
COMPREPLY=($(compgen -W '${commands}' -- ${cur}))