argh icon indicating copy to clipboard operation
argh copied to clipboard

How to access the original command name

Open hellow554 opened this issue 3 years ago • 0 comments

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:

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

hellow554 avatar Jun 28 '21 11:06 hellow554