Skip to content

How to create a cli that operates as a cargo plugin #5561

Answered by epage
NathanFrasier asked this question in Q&A
Discussion options

You must be logged in to vote

I would expect most users of this tool would have cargo installed, so it's not a terrible loss if I limit it to use only as a cargo plugin, however I would prefer to not limit users ability to use this command only if they have cargo installed. Additionally, it simplifies the testing loop when doing development on the tool.

It is unnecessary complexity, adding more corner cases for things to go wrong or to not be as polished for little gain. If you have a binary that is meant to be run outside of cargo, name it as such. If its a cargo plugin, then its that.

The examples provided don't seem to explain which part is the "default subcommand" or what making it a "default subcommand" does. …

Replies: 1 comment 4 replies

Comment options

You must be logged in to vote
4 replies
@NathanFrasier
Comment options

@NathanFrasier
Comment options

@epage
Comment options

Answer selected by NathanFrasier
@NathanFrasier
Comment options

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
2 participants