Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix unrecognized -help flag with default command #612

Merged
merged 1 commit into from
Jan 4, 2024

Conversation

natecook1000
Copy link
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
Member Author

@swift-ci Please test

@natecook1000 natecook1000 merged commit 6c7ec36 into main Jan 4, 2024
@natecook1000 natecook1000 deleted the fix-single-dash-help-flag-skip branch January 4, 2024 20:49
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