Skip to content

Fix unrecognized -help flag with default command#612

Merged
natecook1000 merged 1 commit into
mainfrom
fix-single-dash-help-flag-skip
Jan 4, 2024
Merged

Fix unrecognized -help flag with default command#612
natecook1000 merged 1 commit into
mainfrom
fix-single-dash-help-flag-skip

Conversation

@natecook1000

Copy link
Copy Markdown
Member

When there's a default subcommand that captures pass-through args, only a standalone help flag should trigger help (since the flag should otherwise go to the subcommand). This fix makes that true for single- dash help flag names, which were previously being skipped, due to single-dash flags being lexed as both one whole flag and as a group of individual short flags.

Re: swiftlang/swift-package-manager#7218
Re: rdar://120422808

Checklist

  • I've added at least one test that validates that my change is working, if appropriate
  • I've followed the code style of the rest of the project
  • I've read the Contribution Guidelines
  • I've updated the documentation if necessary

When there's a default subcommand that captures pass-through args,
only a standalone help flag should trigger help (since the flag should
otherwise go to the subcommand). This fix makes that true for single-
dash help flag names, which were previously being skipped, due to
single-dash flags being lexed as both one whole flag and as a group of
individual short flags.

Re: swiftlang/swift-package-manager#7218
Re: rdar://120422808
@natecook1000

Copy link
Copy Markdown
Member Author

@swift-ci Please test

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