mirror of https://github.com/digint/btrbk
contrib: bash: completion.bash: add completion for lsbtr
parent
32c04e0b07
commit
e4f27632a0
3
Makefile
3
Makefile
|
@ -71,6 +71,9 @@ install-completion:
|
||||||
@echo 'installing bash completion...'
|
@echo 'installing bash completion...'
|
||||||
install -d -m 755 "$(DESTDIR)$(BASHCOMPDIR)"
|
install -d -m 755 "$(DESTDIR)$(BASHCOMPDIR)"
|
||||||
install -p -m 644 contrib/bash/completion.bash "$(DESTDIR)$(BASHCOMPDIR)/$(BIN)"
|
install -p -m 644 contrib/bash/completion.bash "$(DESTDIR)$(BASHCOMPDIR)/$(BIN)"
|
||||||
|
for name in $(BIN_LINKS); do \
|
||||||
|
ln -s -n -f $(BIN) "$(DESTDIR)$(BASHCOMPDIR)/$$name"; \
|
||||||
|
done
|
||||||
|
|
||||||
install-systemd:
|
install-systemd:
|
||||||
@echo 'installing systemd service units...'
|
@echo 'installing systemd service units...'
|
||||||
|
|
|
@ -106,4 +106,32 @@ _btrbk()
|
||||||
fi
|
fi
|
||||||
} && complete -F _btrbk btrbk
|
} && complete -F _btrbk btrbk
|
||||||
|
|
||||||
|
_lsbtr()
|
||||||
|
{
|
||||||
|
local cur prev words cword split
|
||||||
|
_init_completion -s || return
|
||||||
|
|
||||||
|
case "$prev" in
|
||||||
|
'-c' | '--config')
|
||||||
|
_filedir
|
||||||
|
return
|
||||||
|
;;
|
||||||
|
'--override')
|
||||||
|
return
|
||||||
|
;;
|
||||||
|
esac
|
||||||
|
|
||||||
|
$split && return
|
||||||
|
|
||||||
|
if [[ $cur == -* ]]; then
|
||||||
|
COMPREPLY=($(compgen -W '$(_parse_help "$1")' -- "$cur"))
|
||||||
|
[[ $COMPREPLY == *= ]] && compopt -o nospace
|
||||||
|
return
|
||||||
|
else
|
||||||
|
# <path>|<url>...
|
||||||
|
_filedir -d
|
||||||
|
return
|
||||||
|
fi
|
||||||
|
} && complete -F _lsbtr lsbtr
|
||||||
|
|
||||||
# ex: filetype=bash
|
# ex: filetype=bash
|
||||||
|
|
Loading…
Reference in New Issue