diff --git a/README.md b/README.md index 6b79b39..71fc0c9 100644 --- a/README.md +++ b/README.md @@ -52,7 +52,7 @@ OPTIONS: -b, --bind ... Specify bind address -p, --port Specify port to listen on [default: 5000] --path-prefix Specify a path prefix - --hidden ... Hide paths from directory listings + --hidden Hide paths from directory listings, separated by `,` -a, --auth ... Add auth for path --auth-method Select auth method [default: digest] [possible values: basic, digest] -A, --allow-all Allow all operations diff --git a/src/args.rs b/src/args.rs index 2eb382c..358a23e 100644 --- a/src/args.rs +++ b/src/args.rs @@ -57,10 +57,7 @@ pub fn build_cli() -> Command<'static> { .arg( Arg::new("hidden") .long("hidden") - .help("Hide paths from directory listings") - .multiple_values(true) - .value_delimiter(',') - .action(ArgAction::Append) + .help("Hide paths from directory listings, separated by `,`") .value_name("value"), ) .arg( @@ -220,8 +217,8 @@ impl Args { format!("/{}/", &encode_uri(&path_prefix)) }; let hidden: Vec = matches - .values_of("hidden") - .map(|v| v.map(|v| v.to_string()).collect()) + .value_of("hidden") + .map(|v| v.split(',').map(|x| x.to_string()).collect()) .unwrap_or_default(); let enable_cors = matches.is_present("enable-cors"); let auth: Vec<&str> = matches