💡 Codex Review
|
string[] adjusted = [_options.DefaultCommand!, .. args]; |
|
ArgParser.ParseResult parse = _parser.Parse (adjusted, defaultCmd); |
Preserve dash-prefixed fallback arguments
When DefaultCommand is used because the original args fail to parse, this reparse still treats the caller's tokens as normal options for the default command. For a default command that accepts positional args, inputs like app --literal or app Alice --suffix now return Unknown option unless those dash-prefixed values happen to be declared options, even though the new DefaultCommand contract says unrecognized options are retried as args to the default command. The fallback path needs a way to pass the original tokens through as positional arguments or otherwise stop option parsing for unknown tokens.
ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
Originally posted by @chatgpt-codex-connector[bot] in #28 (comment)
💡 Codex Review
cli/src/Terminal.Gui.Cli/CliHost.cs
Lines 92 to 93 in 709bd1d
When
DefaultCommandis used because the original args fail to parse, this reparse still treats the caller's tokens as normal options for the default command. For a default command that accepts positional args, inputs likeapp --literalorapp Alice --suffixnow returnUnknown optionunless those dash-prefixed values happen to be declared options, even though the newDefaultCommandcontract says unrecognized options are retried as args to the default command. The fallback path needs a way to pass the original tokens through as positional arguments or otherwise stop option parsing for unknown tokens.ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
Originally posted by @chatgpt-codex-connector[bot] in #28 (comment)