google / google/argh

Assigning `option` arguments with a `=`

Open
#205 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 would be nice to implement option arguments assignment using `=`.

```rust
use argh::FromArgs;

#[derive(FromArgs, Debug)]
#[argh(description = "The best app on earth")]
pub struct Args {
#[argh(option, short = 'a', description = "address to bind to")]
pub address: String,
}
```

This works:
```console
$ cargo run -- --address http://127.0.0.1
```

Would be nice:
```console
$ cargo run -- --address=http://127.0.0.1
```

Right now it spits out this error:
```
Unrecognized argument: "--address=http://127.0.0.1". Did you mean "--address"?
```

Thank you.

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.