Implement basic bash autocompletion in the scripts/bash-autocompletion.sh file.

This commit is contained in:
Username404-59 2021-02-25 22:49:26 +01:00
parent 7ccb83dfce
commit 3ea7d384e0
Signed by: Username404-59
GPG Key ID: 7AB361FBB257A5D1
1 changed files with 14 additions and 0 deletions

View File

@ -1 +1,15 @@
# Bash autocomplete script for yerbacon
_ybconAutoComplete() {
local current previous options
COMPREPLY=()
current="${COMP_WORDS[COMP_CWORD]}"
previous="${COMP_WORDS[COMP_CWORD-1]}"
options="-p --help --printresult"
if [[ ${current} == -* ]]; then
COMPREPLY=( "$(compgen -W "$options" -- "$current")" )
return 0
fi
}
complete -F _ybconAutoComplete ybcon