Skip to content

Assigning option arguments with a = #205

@LeviLovie

Description

@LeviLovie

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.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions