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

cargo component serve does not show in cargo component --help #326

Open
danbugs opened this issue Jul 28, 2024 · 1 comment
Open

cargo component serve does not show in cargo component --help #326

danbugs opened this issue Jul 28, 2024 · 1 comment

Comments

@danbugs
Copy link

danbugs commented Jul 28, 2024

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

enum Command {
Add(AddCommand),
// TODO: Init(InitCommand),
New(NewCommand),
// TODO: Remove(RemoveCommand),
Update(UpdateCommand),
Publish(PublishCommand),
// TODO: Yank(YankCommand),
// TODO: Vendor(VendorCommand),
}

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

enum CargoCommand {
#[default]
Other,
Help,
Build,
Run,
Test,
Bench,
Serve,
}

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

@primoly
Copy link
Contributor

primoly commented Aug 1, 2024

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.

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