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

test: Show conflicts_with kebab-case failure #4759

Closed
wants to merge 1 commit into from

Conversation

chadoh
Copy link

@chadoh chadoh commented Mar 13, 2023

Add a failing test demonstrating that conflicts_with fails when given a kebab-case argument.

Given that multi-word arguments are referred to using kebab-case for their long names and when parsed from the command line, it is reasonable to expect that they can be referred to using kebab case when specified in a conflicts_with argument.

This worked in Clap v3 (or at least v3.1.8, see stellar/soroban-cli#491)

@chadoh chadoh force-pushed the bug/conflicts-with-kebab-case branch 2 times, most recently from 67cf4b5 to 076f58b Compare March 13, 2023 15:26
@chadoh chadoh changed the title bug: conflicts_with fails with kebab case test: Show conflicts_with kebab-case failure Mar 13, 2023
Add a failing test demonstrating that `conflicts_with` fails when given
a kebab-case argument.

Given that multi-word arguments are referred to using kebab-case for
their long names and when parsed from the command line, it is reasonable
to expect that they can be referred to using kebab case when specified
in a `conflicts_with` argument.

This worked in Clap v3 (or at least v3.1.8, see
stellar/soroban-cli#491)
@chadoh chadoh force-pushed the bug/conflicts-with-kebab-case branch from 076f58b to ec3906d Compare March 13, 2023 15:29
@epage
Copy link
Member

epage commented Mar 13, 2023

This is covered in the 4.0.0 changelog under

(derive) Leave Arg::id as verbatim casing, requiring updating of string references to other args like in conflicts_with or requires (#3282)

You need to update conflicts_with = "hh-os" to conflicts_with = "hh_os"

Also, in the future I would prefer Discussions for support or Issues for presumed bugs,. leaving PRs for a fix once there is an agreed to problem. This makes makes it much easier to track the various conversations.

@epage epage closed this Mar 13, 2023
@chadoh chadoh deleted the bug/conflicts-with-kebab-case branch March 13, 2023 18:49
@chadoh
Copy link
Author

chadoh commented Mar 13, 2023

Thanks, @epage!

I wanted to make some sort of paper trail (like a PR) to make the problem & solution easier to find for others.

I thought open source etiquette was always to add PRs for (presumed) bugs with failing tests demonstrating the exact behavior in question. Sorry about that; I'll make a Discussion next time.

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.

None yet

2 participants