Skip to content

Use Clap to handle unrecognized commands in xtask #2741

@egithinji

Description

@egithinji

Could you look into using a Rust enum to represent the available commands? I'm pretty sure Clap can be told that a command line argument must be a valid enum variant — and so it can return an error earlier if people use an unrecognized name.

I think there is an example of what I mean here: https://docs.rs/clap/latest/clap/_cookbook/cargo_example_derive/index.html

We want each xtask (such as install-tools) to become a sub-command.

Originally posted by @mgeisler in #2707 (comment)

Metadata

Metadata

Assignees

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