argh icon indicating copy to clipboard operation
argh copied to clipboard

Assigning `option` arguments with a `=`

Open LeviLovie opened this issue 6 months ago • 0 comments

It would be nice to implement option arguments assignment using =.

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:

$ cargo run -- --address http://127.0.0.1

Would be nice:

$ 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.

LeviLovie avatar Aug 17 '25 13:08 LeviLovie