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

Sort tips by their likely usefulness #5875

Open
2 tasks done
nazar-pc opened this issue Jan 9, 2025 · 2 comments
Open
2 tasks done

Sort tips by their likely usefulness #5875

nazar-pc opened this issue Jan 9, 2025 · 2 comments
Labels
C-enhancement Category: Raise on the bar on expectations

Comments

@nazar-pc
Copy link

nazar-pc commented Jan 9, 2025

Please complete the following tasks

Clap Version

4.5.18

Describe your use case

When user uses incorrect CLI options, clap tries to generate a helpful error message:

Usage: subspace-farmer cluster --nats-server <NATS_SERVERS> cache <DISK_CACHES|--tmp <TMP>|--cache-group <CACHE_GROUP>|--service-instances <SERVICE_INSTANCES>|ADDITIONAL_COMPONENTS>
  tip: to pass '--cache-groups' as a value, use '-- --cache-groups'
  tip: a similar argument exists: '--cache-group'
error: unexpected argument '--cache-groups' found

The issue here is that "tip: to pass '--abc' as a value, use '-- --abc'" is rarely a desired outcome in my experience.

What is more helpful is the next tip after that indicating a minor typo.

Describe the solution you'd like

Sort tips with those that are more likely to happen first, in above example suggest to use similarly named CLI option before value argument.

Alternatives, if applicable

No response

Additional Context

No response

@nazar-pc nazar-pc added the C-enhancement Category: Raise on the bar on expectations label Jan 9, 2025
@epage
Copy link
Member

epage commented Jan 9, 2025

Do you have minimal reproduction steps for getting that error message? Our tests are showing those error messages in the reverse order and I can't see how that order would happen when inspecting the code.

@nazar-pc
Copy link
Author

nazar-pc commented Jan 9, 2025

Not a minimal reproduction yet, but the full app is here: https://github.com/autonomys/subspace/tree/mainnet-2024-dec-09/crates/subspace-farmer

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
C-enhancement Category: Raise on the bar on expectations
Projects
None yet
Development

No branches or pull requests

2 participants