From 0d08d36bd3c2a315c8d3666a17ce6f3d88fd6990 Mon Sep 17 00:00:00 2001 From: Dawid Makowski Date: Thu, 13 Oct 2022 12:46:21 +0800 Subject: [PATCH] Adding artisan & art autocomplete in BASH --- workspace/aliases.sh | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/workspace/aliases.sh b/workspace/aliases.sh index 4bf0d572..9d756b2f 100644 --- a/workspace/aliases.sh +++ b/workspace/aliases.sh @@ -148,3 +148,14 @@ function fs() { du $arg .[^.]* ./*; 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