google / google/argh

How to access the original command name

Open
#94 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

Typically `std::env::args::nth(0)` contains the binary execution name.
How am I going to access it when I use `#[derive(FromArgs)]`?

---

I would like to have something like this:

```rust
#[derive(FromArgs)]
struct Args {
#[argh(command_name)]
cmd_name: String,
}
```

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.