File tree 4 files changed +21
-3
lines changed
src/Symfony/Component/Console 4 files changed +21
-3
lines changed Original file line number Diff line number Diff line change 1
1
CHANGELOG
2
2
=========
3
3
4
+ 7.2
5
+ ---
6
+
7
+ * Allow to override the command used to execute the application during autocompletion
8
+
4
9
7.1
5
10
---
6
11
Original file line number Diff line number Diff line change @@ -18,7 +18,8 @@ _sf_{{ COMMAND_NAME }}() {
18
18
19
19
# Use newline as only separator to allow space in completion values
20
20
IFS=$' \n '
21
- local sf_cmd=" ${COMP_WORDS[0]} "
21
+ # _SF_CMD allows Symfony CLI to tell us to use a different command to run the console
22
+ local sf_cmd=" ${_SF_CMD:- ${COMP_WORDS[0]} } "
22
23
23
24
# for an alias, get the real script behind it
24
25
sf_cmd_type=$( type -t $sf_cmd )
Original file line number Diff line number Diff line change @@ -9,7 +9,18 @@ function _sf_{{ COMMAND_NAME }}
9
9
set sf_cmd (commandline -o )
10
10
set c (count (commandline -oc ))
11
11
12
- set completecmd " $sf_cmd [1]" " _complete" " --no-interaction" " -sfish" " -a{{ VERSION }}"
12
+ # _SF_CMD allows Symfony CLI to tell us to use a different command to run the console
13
+ if set -q _SF_CMD; and test -n _SF_CMD
14
+ for i in $_ SF_CMD
15
+ if [ $i != " " ]
16
+ set completecmd $completecmd " $i "
17
+ end
18
+ end
19
+ else
20
+ set completecmd $completecmd $sf_cmd [1]
21
+ end
22
+
23
+ set completecmd $completecmd " _complete" " --no-interaction" " -sfish" " -a{{ VERSION }}"
13
24
14
25
for i in $sf_cmd
15
26
if [ $i != " " ]
Original file line number Diff line number Diff line change @@ -33,7 +33,8 @@ _sf_{{ COMMAND_NAME }}() {
33
33
fi
34
34
35
35
# Prepare the command to obtain completions
36
- requestComp=" ${words[0]} ${words[1]} _complete --no-interaction -szsh -a{{ VERSION }} -c$(( CURRENT- 1 )) " i=" "
36
+ # _SF_CMD allows Symfony CLI to tell us to use a different command to run the console
37
+ requestComp=" ${words[0]} ${_SF_CMD:- ${words[1]} } _complete --no-interaction -szsh -a{{ VERSION }} -c$(( CURRENT- 1 )) " i=" "
37
38
for w in ${words[@]} ; do
38
39
w=$( printf -- ' %b' " $w " )
39
40
# remove quotes from typed values
You can’t perform that action at this time.
0 commit comments