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

ux: similar subcommand tip shows deprecated subcommands #5335

Open
necauqua opened this issue Jan 10, 2025 · 6 comments
Open

ux: similar subcommand tip shows deprecated subcommands #5335

necauqua opened this issue Jan 10, 2025 · 6 comments
Labels
polish🪒🐃 Make existing features more convenient and more consistent

Comments

@necauqua
Copy link
Contributor

Description

We have some subcommands that were removed/renamed, but we actually left a hidden stub that prints out a helpful redirect to the new name or a way to do what the subcommand did.

The similarity hint should not show those stubs.

Steps to Reproduce the Problem

  1. jj reverse @-
  2. tip shows subcommand 'revert' exists
  3. jj revert - but 'revert' was renamed to 'backout' and surfaces a hint.

Expected Behavior

The tip should not mention 'revert', just feels a bit unpolished.

Maybe it could've been smart enough to suggest 'backout' when I did 'reverse', but that's not a point of this issue.

Actual Behavior

image

Specifications

  • Version: jj 0.24.0-1d3c3b8ab207e66c978ed026a7393682989111c5
@necauqua necauqua added the polish🪒🐃 Make existing features more convenient and more consistent label Jan 10, 2025
@necauqua necauqua changed the title ux: similar subcommand tip seems to show deprecated(?) subcommands ux: similar subcommand tip shows deprecated subcommands Jan 10, 2025
@martinvonz
Copy link
Member

That's from PR #2580. Maybe we can make the error clearer.

@necauqua
Copy link
Contributor Author

#[command(hide = true,

Seems like a clap issue then

@necauqua
Copy link
Contributor Author

necauqua commented Jan 10, 2025

make the error clearer

No the error is fine, the issue is that the similarity tip should not list those hidden subcommands (at least in our case as we use them for those hinting stubs) nor should they be in completion - which they are, too, as I just checked

@martinvonz
Copy link
Member

I agree but I think the hint comes from clap so it might be harder to do. Maybe we've talked about this before with the clap folks?

@bnjmnt4n
Copy link
Member

Relevant: clap-rs/clap#4853

@yuja
Copy link
Contributor

yuja commented Jan 11, 2025

FWIW, it would be nice if revert weren't implemented as a command so user can alias it to whatever they need. I have no idea if that can be doable by inspecting clap::Error or something, though.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
polish🪒🐃 Make existing features more convenient and more consistent
Projects
None yet
Development

No branches or pull requests

4 participants