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

Refactor subcommand addition for sharing. #4474

Merged
merged 2 commits into from
Nov 4, 2024

Conversation

jonmeow
Copy link
Contributor

@jonmeow jonmeow commented Nov 2, 2024

Trying to standardize the setup a little more.

Copy link
Contributor

@chandlerc chandlerc left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LG with one comment inline.

Comment on lines 31 to 33
// Adds the subcommand to the main command, assigning `selected_command` when
// the subcommand is in use.
auto AddSubcommand(CommandLine::CommandBuilder& b,
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Calling this method AddSubcommand ends up a bit confusing for me because the relationship between this and b are reversed here vs. the analogous method on b.

Maybe a slightly different name would make the relationship more clear?
RegisterWith or AddTo?

Happy for that to be in this PR or a follow-up if that's easier for you.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Going with AddTo

@jonmeow jonmeow added this pull request to the merge queue Nov 4, 2024
Merged via the queue into carbon-language:trunk with commit 26e58b4 Nov 4, 2024
8 checks passed
@jonmeow jonmeow deleted the subcommand branch November 4, 2024 22:55
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants