From 3ea7d384e0aaa0c7934b681efa06a7b59f09189f Mon Sep 17 00:00:00 2001 From: Username404-59 Date: Thu, 25 Feb 2021 22:49:26 +0100 Subject: [PATCH] Implement basic bash autocompletion in the scripts/bash-autocompletion.sh file. --- scripts/bash-completion.sh | 14 ++++++++++++++ 1 file changed, 14 insertions(+) diff --git a/scripts/bash-completion.sh b/scripts/bash-completion.sh index ee4ecd9..8e92018 100644 --- a/scripts/bash-completion.sh +++ b/scripts/bash-completion.sh @@ -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 \ No newline at end of file