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 duplication of aliases in subcommands #504

Merged
merged 1 commit into from Oct 18, 2021

Conversation

michiel-de-muynck
Copy link
Contributor

This PR fixes the issue where all top level methods were duplicated for subcommands with fields (see issue #418). For some attributes, such as aliases, this resulted in duplicate output.

The issue was caused by the fact that for named enum variants gen_augmentation was used to generate the clap data, which already parses the attributes, while later on attrs.top_level_methods() was used to parse attributes again, so that the attributes were parsed and generated twice. For some attributes, this merely resulted in the attribute being set twice, which is fairly harmless, but for some attributes, such as aliases, this resulted in the alias being added to the vector of aliases twice, which in turn causes the alias to be printed twice in the help message.

Fixes #418

This commit fixes the issue where all top level methods were duplicated
for subcommands with fields (see issue TeXitoi#418). For some attributes, such
as aliases, this resulted in duplicate output.
@TeXitoi
Copy link
Owner

TeXitoi commented Oct 18, 2021

Thanks

@TeXitoi
Copy link
Owner

TeXitoi commented Oct 18, 2021

v0.3.24 published

@TeXitoi
Copy link
Owner

TeXitoi commented Oct 18, 2021

Sorry, bad publication, this PR is in v0.3.25

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.

SubCommand enum variant with fields duplicates parent attributes
2 participants