File tree Expand file tree Collapse file tree 1 file changed +5
-0
lines changed
Expand file tree Collapse file tree 1 file changed +5
-0
lines changed Original file line number Diff line number Diff line change @@ -494,6 +494,7 @@ _set_new_action() {
494494# ${!x} -> ${hello} -> "world"
495495_shtab_blocksatcli() {
496496 local completing_word="${COMP_WORDS[COMP_CWORD]}"
497+ local previous_word="${COMP_WORDS[COMP_CWORD-1]}"
497498 local completed_positional_actions
498499 local current_action
499500 local current_action_args_start_index
@@ -550,6 +551,10 @@ _shtab_blocksatcli() {
550551 if [[ $pos_only = 0 && "${completing_word}" == -* ]]; then
551552 # optional argument started: use option strings
552553 COMPREPLY=( $(compgen -W "${current_option_strings[*]}" -- "${completing_word}") )
554+ elif [[ "${previous_word}" == ">" || "${previous_word}" == ">>" ||
555+ "${previous_word}" =~ ^[12]">" || "${previous_word}" =~ ^[12]">>" ]]; then
556+ # handle redirection operators
557+ COMPREPLY=( $(compgen -f -- "${completing_word}") )
553558 else
554559 # use choices & compgen
555560 local IFS=$'\n' # items may contain spaces, so delimit using newline
You can’t perform that action at this time.
0 commit comments