Skip to content

Fix autocomplete when parameter appears in parenthesis#46

Merged
gcbeltramini merged 1 commit into
mainfrom
gb/parenthesis-docopt
May 31, 2026
Merged

Fix autocomplete when parameter appears in parenthesis#46
gcbeltramini merged 1 commit into
mainfrom
gb/parenthesis-docopt

Conversation

@gcbeltramini
Copy link
Copy Markdown
Owner

No description provided.

Copy link
Copy Markdown
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

This PR updates CLI autocomplete parsing so option names inside parenthesized docopt groups do not include parentheses, and makes argument-description lookup robust when the current input contains regex metacharacters.

Changes:

  • Normalizes docopt grouping separators before extracting option parameters.
  • Switches zsh argument-description matching from regex grep to exact token matching with awk.
  • Adds regression tests for parenthesized options and regex-like partial input.

Reviewed changes

Copilot reviewed 2 out of 2 changed files in this pull request and generated 1 comment.

File Description
core/cli_root/autocomplete_helpers.sh Updates parameter extraction and argument-description lookup logic.
tests/core/cli_root/test_autocomplete_helpers.sh Adds regression coverage for parenthesized option groups and invalid-regex-like input.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment on lines +94 to +95
sed -E 's/^\[+// ; s/[=,].*$// ; s/\]+$//' |
grep -E -- '^--?[[:alnum:]_][[:alnum:]_-]*$' || :
Copy link
Copy Markdown
Owner Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Probably we won't have this usage.

@gcbeltramini gcbeltramini merged commit c22c2c2 into main May 31, 2026
2 checks passed
@gcbeltramini gcbeltramini deleted the gb/parenthesis-docopt branch May 31, 2026 21:05
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants