contrib: bash: completion.bash: add action "extents"

pull/358/head
Axel Burri 2020-12-20 18:13:30 +01:00
parent 4fa6dfde25
commit 497b4e132e
1 changed files with 10 additions and 1 deletions

View File

@ -51,7 +51,7 @@ _btrbk()
[[ $COMPREPLY == *= ]] && compopt -o nospace [[ $COMPREPLY == *= ]] && compopt -o nospace
else else
if [[ ! -v 'cmds[0]' ]]; then if [[ ! -v 'cmds[0]' ]]; then
COMPREPLY=($(compgen -W 'run dryrun snapshot resume prune archive clean stats list usage origin diff ls' -- "$cur")) COMPREPLY=($(compgen -W 'run dryrun snapshot resume prune archive clean stats list usage origin diff extents ls' -- "$cur"))
fi fi
fi fi
@ -83,6 +83,15 @@ _btrbk()
# <path>|<url>... # <path>|<url>...
_filedir -d _filedir -d
;; ;;
'extents')
# [diff] <path>... [exclusive] <path>...
if [[ ! -v 'cmds[1]' ]]; then
COMPREPLY+=($(compgen -W 'diff' -- "$cur"))
elif [[ ! ${cmds[*]} =~ (^|[[:space:]])"exclusive"($|[[:space:]]) ]]; then
COMPREPLY+=($(compgen -W 'exclusive' -- "$cur"))
fi
_filedir -d
;;
esac esac
} && complete -F _btrbk btrbk } && complete -F _btrbk btrbk