Skip to content

Commit

Permalink
Merge pull request #144 from scop/refactor/bash-no-regex
Browse files Browse the repository at this point in the history
  • Loading branch information
casperdcl authored Jul 28, 2023
2 parents 2e017b1 + b0f2e4a commit 56beb5f
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions shtab/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -394,13 +394,13 @@ def complete_bash(parser, root_prefix=None, preamble="", choice_functions=None):
while [ $word_index -ne $COMP_CWORD ]; do
local this_word="${COMP_WORDS[$word_index]}"
if [[ -n $sub_parsers && " ${sub_parsers[@]} " =~ " ${this_word} " ]]; then
if [[ -n $sub_parsers && " ${sub_parsers[@]} " == *" ${this_word} "* ]]; then
# valid subcommand: add it to the prefix & reset the current action
prefix="${prefix}_$(_shtab_replace_nonword $this_word)"
_set_parser_defaults
fi
if [[ " ${current_option_strings[@]} " =~ " ${this_word} " ]]; then
if [[ " ${current_option_strings[@]} " == *" ${this_word} "* ]]; then
# a new action should be acquired (due to recognised option string or
# no more input expected from current action);
# the next positional action can fill in here
Expand Down

0 comments on commit 56beb5f

Please sign in to comment.