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

Fails as cargo subcommand #4

Closed
dspicher opened this issue Dec 3, 2019 · 4 comments
Closed

Fails as cargo subcommand #4

dspicher opened this issue Dec 3, 2019 · 4 comments

Comments

@dspicher
Copy link

dspicher commented Dec 3, 2019

When invoked as a subcommand, cargo sort-ck fails because of how cargo passes on the command name as an argument:

"When Cargo invokes a custom subcommand, the first argument to the subcommand will be the filename of the custom subcommand, as usual. The second argument will be the subcommand name itself. For example, the second argument would be ${command} when invoking cargo-${command}. Any additional arguments on the command line will be forwarded unchanged."

https://doc.rust-lang.org/cargo/reference/external-tools.html#custom-subcommands

╰─$ cargo sort-ck                                                                                                                                                                                     101 ↵
Failure: No file found at: sort-ck/Cargo.toml

Is there a way to make the arguments to cargo-sort-ck consistent with how cargo passes them to subcommands?

@DevinR528
Copy link
Owner

First thank you for your interest.

Yea I was hoping I could get this to work when I first wrote this. I filed an issue with the cargo repo because every other crate that works as a subcommand seems to be doing the same things as this crate, I will keep investigating.

@DevinR528
Copy link
Owner

This commit if your curious fixes issue #4. Hope that works if you update your cargo-sort-ck version you should be good to go I published a new release.

@dspicher
Copy link
Author

dspicher commented Dec 4, 2019

Just tested it, confirmed fixed. Thanks a lot for the quick response!!

@dspicher dspicher closed this as completed Dec 4, 2019
@dspicher
Copy link
Author

dspicher commented Dec 4, 2019

And thanks for the shoutout on the REAMDE :))

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

No branches or pull requests

2 participants