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

Incorrect suggestion when creating a new project with --backend instead of --build-backend #8743

Closed
styvane opened this issue Nov 1, 2024 · 5 comments · Fixed by #10958
Closed
Labels
cli Related to the command line interface upstream An upstream dependency is involved

Comments

@styvane
Copy link
Contributor

styvane commented Nov 1, 2024

uv suggests the wrong argument when creating a new project with a wrong --backend argument

uv init  --lib --backend maturin no-name

It returns the following error message:

error: unexpected argument '--backend' found

  tip: a similar argument exists: '--package'

Usage: uv init <PATH|--name <NAME>|--virtual|--package|--no-package|--app|--lib|--script|--vcs <VCS>|--build-backend <BUILD_BACKEND>|--no-readme|--author-from <AUTHOR_FROM>|--no-pin-python|--no-workspace|--python <PYTHON>>

For more information, try '--help'.

I was expecting the suggestion to be a similar argument exists: --build-backend

Version:

uv --version
uv 0.4.25 (97eb6ab4a 2024-10-21)
@charliermarsh charliermarsh added the cli Related to the command line interface label Nov 1, 2024
@charliermarsh
Copy link
Member

That's an odd one though I don't think we control these suggestions.

@zanieb zanieb added the upstream An upstream dependency is involved label Nov 1, 2024
@zanieb
Copy link
Member

zanieb commented Nov 1, 2024

Yeah these are implemented in Clap, not sure what we can do here.

@zanieb
Copy link
Member

zanieb commented Nov 1, 2024

I guess we can declare a hidden --backend argument with UnknownArgumentValueParser and suggest the proper one. There are some minor caveats, as discussed in clap-rs/clap#5781 (though that mostly focused on subcommands).

@styvane
Copy link
Contributor Author

styvane commented Jan 24, 2025

I can try to implement this if that is ok

@zanieb
Copy link
Member

zanieb commented Jan 24, 2025

@styvane sure!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
cli Related to the command line interface upstream An upstream dependency is involved
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants