Skip to content

Preserve dash-prefixed fallback arguments #30

@tig

Description

@tig

💡 Codex Review

string[] adjusted = [_options.DefaultCommand!, .. args];
ArgParser.ParseResult parse = _parser.Parse (adjusted, defaultCmd);

P2 Badge 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)

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions