From 497b4e132eef87efb9bc23a3a53f7fbcdfe830b4 Mon Sep 17 00:00:00 2001 From: Axel Burri Date: Sun, 20 Dec 2020 18:13:30 +0100 Subject: [PATCH] contrib: bash: completion.bash: add action "extents" --- contrib/bash/completion.bash | 11 ++++++++++- 1 file changed, 10 insertions(+), 1 deletion(-) 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