cargo-component icon indicating copy to clipboard operation
cargo-component copied to clipboard

`cargo component serve` does not show in `cargo component --help`

Open danbugs opened this issue 1 year ago • 1 comments

cargo component serve does not show in cargo component --help and this is because serve isn't a directly supported cargo-component command, like:

https://github.com/bytecodealliance/cargo-component/blob/50634428915707b34b49bebe85efb48ca82b27ca/src/bin/cargo-component.rs#L67-L76

And, instead, it is a cargo command (not really, but, as per the code's nomenclature, yes):

https://github.com/bytecodealliance/cargo-component/blob/50634428915707b34b49bebe85efb48ca82b27ca/src/lib.rs#L74-L83

I think it would be helpful to add serve as a proper cargo-component command for discoverability of the feature*.

danbugs avatar Jul 28 '24 21:07 danbugs

When I added serve I just treated it as a special case of run. That’s why it’s in CargoCommand instead of Command.

I didn’t know that CargoCommands don’t get help support. Maybe this should be added for all of them, not just serve. It seems a bit strange that --help doesn’t list all commands available. A user has to guess that cargo component has for example its own run command, but fmt is just propagated. The current --help makes it seem like all subcommands except for the ones in the Command enum are propagated.

primoly avatar Aug 01 '24 20:08 primoly