google / google/argh

Reject subcommands that contain spaces in them

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

Description

It's rather surprising that we can do this:

```
use argh::FromArgs;

#[derive(FromArgs)]
#[argh(description="")]
struct Cmd {
#[argh(subcommand)]
_sub: SubCmd,
}

#[derive(FromArgs)]
#[argh(subcommand, name = "sub sub", description="")]
struct SubCmd {}

fn main() {
let _cmd: Cmd = argh::from_env();
}
```

We can then execute this by running `cargo run -- "sub sub"`. We should probably explicitly reject this.

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.