Skip to content

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

Open

Description

@danbugs

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*.

Activity

  1. primoly commented on Aug 1, 2024

    @primoly
    Contributor

    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

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions