diff options
author | boastful-squirrel <boastful.squirrel@gmail.com> | 2019-11-21 22:57:49 +0000 |
---|---|---|
committer | boastful-squirrel <boastful.squirrel@gmail.com> | 2019-11-21 22:57:49 +0000 |
commit | 1bc09afa2945f6eadd74193802abe4d4f4e4fe75 (patch) | |
tree | ee6fb7967925a225489d37979484fc779964400b /src/args.rs | |
parent | Fix html elements order (diff) | |
parent | Merge pull request #217 from svenstaro/dependabot/cargo/port_check-0.1.2 (diff) | |
download | miniserve-1bc09afa2945f6eadd74193802abe4d4f4e4fe75.tar.gz miniserve-1bc09afa2945f6eadd74193802abe4d4f4e4fe75.zip |
Merge branch 'master' into fix-#173
Diffstat (limited to 'src/args.rs')
-rw-r--r-- | src/args.rs | 19 |
1 files changed, 10 insertions, 9 deletions
diff --git a/src/args.rs b/src/args.rs index 925d3dd..8fde78a 100644 --- a/src/args.rs +++ b/src/args.rs @@ -14,7 +14,9 @@ const ROUTE_ALPHABET: [char; 16] = [ #[derive(StructOpt)] #[structopt( name = "miniserve", - raw(global_settings = "&[structopt::clap::AppSettings::ColoredHelp]") + author, + about, + global_settings = &[structopt::clap::AppSettings::ColoredHelp], )] struct CLIArgs { /// Be verbose, includes emitting access logs @@ -33,8 +35,8 @@ struct CLIArgs { #[structopt( short = "i", long = "interfaces", - parse(try_from_str = "parse_interface"), - raw(number_of_values = "1") + parse(try_from_str = parse_interface), + number_of_values = 1, )] interfaces: Vec<IpAddr>, @@ -44,8 +46,8 @@ struct CLIArgs { #[structopt( short = "a", long = "auth", - parse(try_from_str = "parse_auth"), - raw(number_of_values = "1") + parse(try_from_str = parse_auth), + number_of_values = 1, )] auth: Vec<auth::RequiredAuth>, @@ -62,10 +64,8 @@ struct CLIArgs { short = "c", long = "color-scheme", default_value = "Squirrel", - raw( - possible_values = "&themes::ColorScheme::variants()", - case_insensitive = "true", - ) + possible_values = &themes::ColorScheme::variants(), + case_insensitive = true, )] color_scheme: themes::ColorScheme, @@ -172,6 +172,7 @@ pub fn parse_args() -> crate::MiniserveConfig { mod tests { use super::*; use rstest::rstest_parametrize; + use pretty_assertions::assert_eq; /// Helper function that creates a `RequiredAuth` structure fn create_required_auth(username: &str, password: &str, encrypt: &str) -> auth::RequiredAuth { |