Skip to content

Commit 516a268

Browse files
committed
Use file system completion for redirect operators
1 parent 2655810 commit 516a268

File tree

1 file changed

+10
-0
lines changed

1 file changed

+10
-0
lines changed

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)