Merge pull request #2017 from gaelicWizard/lib/preview

lib/preview: functionalize
This commit is contained in:
Noah Gorny
2022-02-13 23:59:06 +02:00
committed by GitHub
6 changed files with 50 additions and 24 deletions

View File

@@ -13,7 +13,7 @@ function _bash-it() {
prev="${COMP_WORDS[COMP_CWORD - 1]}"
verb="${COMP_WORDS[1]}"
file_type="${COMP_WORDS[2]:-}"
candidates=('disable' 'enable' 'help' 'migrate' 'reload' 'restart' 'profile' 'doctor' 'search' 'show' 'update' 'version')
candidates=('disable' 'enable' 'help' 'migrate' 'reload' 'restart' 'preview' 'profile' 'doctor' 'search' 'show' 'update' 'version')
case "${verb}" in
show)
candidates=('aliases' 'completions' 'plugins')
@@ -59,6 +59,10 @@ function _bash-it() {
_compreply_candidates
;;
migrate | reload | restart | search | version) ;;
preview)
_bash-it-preview # completes itself
return 0
;;
enable | disable)
if [[ "${verb}" == "enable" ]]; then
suffix="disabled"