Default subcommand
Open
- Dominant language
- Rust
- Stars
- 2k
- Forks
- 102
- PR merge metrics
- No merged PRs in 30d
Description
Is it possible to make a default subcommand with `argh`? I want something like this:
```rust
#[derive(FromArgs, PartialEq, Debug)]
/// Top-level command.
struct TopLevel {
#[argh(subcommand)]
nested: Sub,
}
#[derive(FromArgs, PartialEq, Debug)]
#[argh(subcommand)]
enum Sub {
#[argh(default)] // <-----
One(SubCommandOne),
Two(SubCommandTwo),
}
/* one and two subcommands*/
```
With
- `cmd one ...` resulting in `Sub::One(..)`
- `cmd two ...` resulting in `Sub::Two(..)`
- `cmd ...` resulting in `Sub::One(..)` (the default)
Contributor guide
Assessment
This issue has not been assessed yet.