diff --git a/contrib/bash/completion.bash b/contrib/bash/completion.bash index a7fd1e7..8d1101d 100644 --- a/contrib/bash/completion.bash +++ b/contrib/bash/completion.bash @@ -51,7 +51,7 @@ _btrbk() [[ $COMPREPLY == *= ]] && compopt -o nospace else 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 @@ -83,6 +83,15 @@ _btrbk() # |... _filedir -d ;; + 'extents') + # [diff] ... [exclusive] ... + 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 } && complete -F _btrbk btrbk