aboutsummaryrefslogtreecommitdiffstats
path: root/src/args.rs
diff options
context:
space:
mode:
Diffstat (limited to 'src/args.rs')
-rw-r--r--src/args.rs19
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 {