Skip to content

Commit

Permalink
Fix incorrect Bash completions after --long-opt=
Browse files Browse the repository at this point in the history
This is because `$COMP_CWORD` points to that `=` "word".
  • Loading branch information
ISSOtm committed Aug 10, 2022
1 parent 9ef7954 commit 0105779
Show file tree
Hide file tree
Showing 4 changed files with 4 additions and 4 deletions.
2 changes: 1 addition & 1 deletion contrib/bash_compl/_rgbasm.bash
Original file line number Diff line number Diff line change
Expand Up @@ -130,7 +130,7 @@ _rgbasm_completions() {

# Parse current word
# Careful that it might look like an option, so use `--` aggressively!
local cur_word="${COMP_WORDS[$COMP_CWORD]}"
local cur_word="${COMP_WORDS[$i]}"

# Process options, as short ones may change the state
if $opt_ena && [[ "$state" = 'normal' && "$cur_word" = '-'* ]]; then
Expand Down
2 changes: 1 addition & 1 deletion contrib/bash_compl/_rgbfix.bash
Original file line number Diff line number Diff line change
Expand Up @@ -101,7 +101,7 @@ _rgbfix_completions() {

# Parse current word
# Careful that it might look like an option, so use `--` aggressively!
local cur_word="${COMP_WORDS[$COMP_CWORD]}"
local cur_word="${COMP_WORDS[$i]}"

# Process options, as short ones may change the state
if $opt_ena && [[ "$state" = 'normal' && "$cur_word" = '-'* ]]; then
Expand Down
2 changes: 1 addition & 1 deletion contrib/bash_compl/_rgbgfx.bash
Original file line number Diff line number Diff line change
Expand Up @@ -109,7 +109,7 @@ _rgbgfx_completions() {

# Parse current word
# Careful that it might look like an option, so use `--` aggressively!
local cur_word="${COMP_WORDS[$COMP_CWORD]}"
local cur_word="${COMP_WORDS[$i]}"

# Process options, as short ones may change the state
if $opt_ena && [[ "$state" = 'normal' && "$cur_word" = '-'* ]]; then
Expand Down
2 changes: 1 addition & 1 deletion contrib/bash_compl/_rgblink.bash
Original file line number Diff line number Diff line change
Expand Up @@ -99,7 +99,7 @@ _rgblink_completions() {

# Parse current word
# Careful that it might look like an option, so use `--` aggressively!
local cur_word="${COMP_WORDS[$COMP_CWORD]}"
local cur_word="${COMP_WORDS[$i]}"

# Process options, as short ones may change the state
if $opt_ena && [[ "$state" = 'normal' && "$cur_word" = '-'* ]]; then
Expand Down

0 comments on commit 0105779

Please sign in to comment.