Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Commit 26f209d

Browse files
committed
feature symfony#49762 [Console] Use file system completion for redirect operators (Chi-teck)
This PR was merged into the 6.3 branch. Discussion ---------- [Console] Use file system completion for redirect operators | Q | A | ------------- | --- | Branch? | 6.3 | Bug fix? | yes | Tickets | symfony#49761 | License | MIT The approach is similar to systemd/systemd#12089. I also added input redirect operator. Commits ------- 44726c4 Use file system completion for redirect operators
2 parents 2e31041 + 44726c4 commit 26f209d

File tree

1 file changed

+10
-0
lines changed

1 file changed

+10
-0
lines changed

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

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,16 @@
66
# https://symfony.com/doc/current/contributing/code/license.html
77

88
_sf_{{ COMMAND_NAME }}() {
9+
10+
# Use the default completion for shell redirect operators.
11+
for w in '>' '>>' '&>' '<'; do
12+
if [[ $w = "${COMP_WORDS[COMP_CWORD-1]}" ]]; then
13+
compopt -o filenames
14+
COMPREPLY=($(compgen -f -- "${COMP_WORDS[COMP_CWORD]}"))
15+
return 0
16+
fi
17+
done
18+
919
# Use newline as only separator to allow space in completion values
1020
IFS=$'\n'
1121
local sf_cmd="${COMP_WORDS[0]}"

0 commit comments

Comments
 (0)