google / google/argh

Garbles help text when subcommand follows a positional argument

Open
#77 2 comments 0 reactions 0 assignees View on GitHub
Dominant language
Rust
Stars
2k
Forks
102
PR merge metrics
No merged PRs in 30d

Description

```rust
/// ...
#[derive(argh::FromArgs)]
struct Opts {
#[argh(positional)]
dbpath: PathBuf,

#[argh(subcommand)]
cmd: Cmd,
}

/// Outout entire content of the database to text file, stdout (suitable for migrations)
#[derive(argh::FromArgs)]
#[argh(subcommand, name = "export")]
struct Export {}

/// Import entire content of the database from text file, stdin (suitable for migrations)
#[derive(argh::FromArgs)]
#[argh(subcommand, name = "import")]
struct Import {}

#[derive(argh::FromArgs)]
#[argh(subcommand)]
enum Cmd {
Export(Export),
Import(Import),
}
```

```
Required positional arguments not provided:
dbpathOne of the following subcommands must be present:
help
export
import
```

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.