Skip to content

Commit 3b60ba1

Browse files
committed
Support completion for bash functions
1 parent 860d86a commit 3b60ba1

File tree

1 file changed

+4
-3
lines changed

1 file changed

+4
-3
lines changed

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

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -11,13 +11,14 @@ _sf_{{ COMMAND_NAME }}() {
1111
local sf_cmd="${COMP_WORDS[0]}"
1212

1313
# for an alias, get the real script behind it
14-
if [[ $(type -t $sf_cmd) == "alias" ]]; then
14+
sf_cmd_type=$(type -t $sf_cmd)
15+
if [[ $sf_cmd_type == "alias" ]]; then
1516
sf_cmd=$(alias $sf_cmd | sed -E "s/alias $sf_cmd='(.*)'/\1/")
16-
else
17+
elif [[ $sf_cmd_type == "file" ]]; then
1718
sf_cmd=$(type -p $sf_cmd)
1819
fi
1920

20-
if [ ! -x "$sf_cmd" ]; then
21+
if [[ $sf_cmd_type != "function" && ! -x $sf_cmd ]]; then
2122
return 1
2223
fi
2324

0 commit comments

Comments
 (0)
pFad - Phonifier reborn

Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy