8000 Handle alias in completion script · symfony/symfony@f3c196a · GitHub
[go: up one dir, main page]

Skip to content

Commit f3c196a

Browse files
committed
Handle alias in completion script
1 parent dcf09d6 commit f3c196a

File tree

1 file changed

+6
-0
lines changed

1 file changed

+6
-0
lines changed

src/Symfony/Component/Console/Resources/completion.bash

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,12 @@ _sf_{{ COMMAND_NAME }}() {
99
# Use newline as only separator to allow space in completion values
1010
IFS=$'\n'
1111
local sf_cmd="${COMP_WORDS[0]}"
12+
13+
# for an alias, get the real script behind it
14+
if [[ $(type -t $sf_cmd) == "alias" ]]; then
15+
sf_cmd=$(alias $sf_cmd | sed -E "s/alias $sf_cmd='(.*)'/\1/")
16+
fi
17+
1218
if [ ! -f "$sf_cmd" ]; then
1319
return 1
1420
fi

0 commit comments

Comments
 (0)
0