Using this code, cargo run -- generate and cargo run -- gen works.
However, after a cargo install, cargo generate works but not cargo gen:
➜ cargo-generate git:(975ea2c) cargo gen --version
error: no such subcommand: `gen`
Did you mean `new`?
I checked quickly the documentation of cargo and did not found something "interesting" about registering the aliases, except maybe registering manually the alias in the ~/.cargo/config...
I am not sure that structopt is doing something at this level, as the cargo documentation explained that they are checking if a binary is a cargo subcommand based on the name of the binary, but I wanted to ask the question just in case.
Hi,
We are working on cargo-generate, a cargo subcommand to generate easily a Rust project based on a template.
We have an issue reported by one of our users here as, after a
cargo install
, the subcommand alias (gen
) is not recognized.As explained in the issue,
cargo run -- gen
is working, but the issue is reported only after installing the binary usingcargo install
.Our current implementation:
Using this code,
cargo run -- generate
andcargo run -- gen
works.However, after a
cargo install
,cargo generate
works but notcargo gen
:I checked quickly the documentation of
cargo
and did not found something "interesting" about registering the aliases, except maybe registering manually the alias in the~/.cargo/config
...I am not sure that
structopt
is doing something at this level, as thecargo
documentation explained that they are checking if a binary is a cargo subcommand based on the name of the binary, but I wanted to ask the question just in case.Thanks in advance!