Skip to content

Instantly share code, notes, and snippets.

@MartinWallgren
Created November 24, 2019 18:17
Show Gist options
  • Save MartinWallgren/c91227539300a44d5d3b476ae9de5656 to your computer and use it in GitHub Desktop.
Save MartinWallgren/c91227539300a44d5d3b476ae9de5656 to your computer and use it in GitHub Desktop.
App::new("rsurl")
.version(crate_version!())
.author(crate_authors!())
.setting(AppSettings::AllowMissingPositional)
.about("Http requests from the command line.")
.arg(
Arg::with_name("body")
.short("b")
.value_name("FILE")
.required(false),
)
.arg(
Arg::with_name("method")
.possible_values(&Method::variants())
.required(false)
.default_value("GET"),
)
.arg(
Arg::with_name("url")
.help("the request url")
.required(true)
.takes_value(true),
)
.get_matches()
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment