Merge pull request #3282 from makowskid/master

Adding `artisan` (and `art`) autocomplete in BASH
This commit is contained in:
Shao Yu-Lung (Allen) 2022-10-23 13:44:40 +08:00 committed by GitHub
commit 61a219e3c3
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 11 additions and 0 deletions

View File

@ -148,3 +148,14 @@ function fs() {
du $arg .[^.]* ./*; du $arg .[^.]* ./*;
fi; fi;
} }
# Add artisan autocomplete
function _artisan()
{
COMP_WORDBREAKS=${COMP_WORDBREAKS//:}
COMMANDS=`php artisan --raw --no-ansi list | sed "s/[[:space:]].*//g"`
COMPREPLY=(`compgen -W "$COMMANDS" -- "${COMP_WORDS[COMP_CWORD]}"`)
return 0
}
complete -F _artisan art
complete -F _artisan artisan