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() {
494
494
# ${!x} -> ${hello} -> "world"
495
495
_shtab_blocksatcli() {
496
496
local completing_word="${COMP_WORDS[COMP_CWORD]}"
497
+ local previous_word="${COMP_WORDS[COMP_CWORD-1]}"
497
498
local completed_positional_actions
498
499
local current_action
499
500
local current_action_args_start_index
@@ -550,6 +551,10 @@ _shtab_blocksatcli() {
550
551
if [[ $pos_only = 0 && "${completing_word}" == -* ]]; then
551
552
# optional argument started: use option strings
552
553
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}") )
553
558
else
554
559
# use choices & compgen
555
560
local IFS=$'\n' # items may contain spaces, so delimit using newline
You can’t perform that action at this time.
0 commit comments