Skip to content

Do not treat input as regex#45

Merged
gcbeltramini merged 2 commits into
mainfrom
gb/fix-regex
May 28, 2026
Merged

Do not treat input as regex#45
gcbeltramini merged 2 commits into
mainfrom
gb/fix-regex

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 hardens the CLI dispatch logic in cli_init.sh so that user-supplied command/subcommand strings are no longer interpreted as regular expressions when matching against discovered scripts. It also fixes a stderr inconsistency in the ambiguous-subcommand listing.

Changes:

  • Replace regex grep "${cmd2}.sh$" with awk basename equality to find an exact subcommand match.
  • Replace regex grep "/${cmd}$" with grep -Fx fixed full-line match for exact command directory match.
  • Send the ambiguous-subcommand listing in run_command() to stderr, consistent with list_commands().

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

@gcbeltramini gcbeltramini merged commit 22e20ef into main May 28, 2026
2 checks passed
@gcbeltramini gcbeltramini deleted the gb/fix-regex branch May 28, 2026 00:20
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