-
-
Notifications
You must be signed in to change notification settings - Fork 1k
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
Program name (bin_name) should be configurable #134
Comments
This shouldn't be too hard, let me play with an implementation idea and I'll post back here. Thanks for taking the time to file this! |
No problem. If it's of any use, the code in question is in cargo-script/v0.1.1. |
Thanks! I was just about to ask. So ideally, you'd like to be able to say the $ cargo script -v
cargo-script v1.0 But in usage strings should be displayed as: USAGE:
cargo script <script> Correct? If that's the case I should have this working in about 10 minutes ;) |
Pretty much, yeah. So long as it doesn't call itself |
Aright, I've got it working tested with this scenario. Uploading now, use 0.10.2 on crates.io |
It's up on crates.io now, you can also use the master branch here. off topic, |
Thanks; updated. |
The first line of the
--help
message for my program is as follows:The obvious issue is that this is hideously ugly, and also misleading. I'm writing a Cargo subcommand and, as such, the user is never going to invoke this program as "cargo-script". I need to tell clap that the program should identify itself as "cargo". Ideally, I'd be able to tell it to lie when using the "script" subcommand, but not when it isn't provided.
I thought about just altering the arguments clap is parsing, but there doesn't appear to be any way to do this.
Also, it would help to not have the file extension present in the name.
The text was updated successfully, but these errors were encountered: