Skip to content

Commit 5ebcdd2

Browse files
Update bash completion to shtab 1.7.2
1 parent 84d52f8 commit 5ebcdd2

File tree

1 file changed

+5
-0
lines changed

1 file changed

+5
-0
lines changed

blocksat-cli.bash-completion

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff 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

0 commit comments

Comments
 (0)