Created
August 24, 2016 20:14
-
-
Save CarsonF/2570352e05711a0bf1b9ba981909a79b to your computer and use it in GitHub Desktop.
Symfony Console Bash Completion
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/env bash | |
function _symfony_complete { | |
local CMDLINE_CONTENTS="$COMP_LINE" | |
local CMDLINE_CURSOR_INDEX="$COMP_POINT" | |
local CMDLINE_WORDBREAKS="$COMP_WORDBREAKS"; | |
export CMDLINE_CONTENTS CMDLINE_CURSOR_INDEX CMDLINE_WORDBREAKS | |
local RESULT STATUS; | |
RESULT="$($1 _completion </dev/null)"; | |
STATUS=$?; | |
local cur mail_check_backup; | |
mail_check_backup=$MAILCHECK; | |
MAILCHECK=-1; | |
_get_comp_words_by_ref -n : cur; | |
if [ $STATUS -eq 200 ]; then | |
_filedir; | |
return 0; | |
elif [ $STATUS -ne 0 ]; then | |
echo -e "$RESULT"; | |
return $?; | |
fi; | |
COMPREPLY=(`compgen -W "$RESULT" -- $cur`); | |
__ltrim_colon_completions "$cur"; | |
MAILCHECK=mail_check_backup; | |
}; | |
complete -F _symfony_complete "console" "nut"; |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment