chore: undo hidden arg changes

This commit is contained in:
sigoden 2022-09-09 21:30:27 +08:00
parent 68def1c1d9
commit 7eaa6f2484
2 changed files with 4 additions and 7 deletions

View file

@ -52,7 +52,7 @@ OPTIONS:
-b, --bind <addr>... Specify bind address
-p, --port <port> Specify port to listen on [default: 5000]
--path-prefix <path> Specify a path prefix
--hidden <value>... Hide paths from directory listings
--hidden <value> Hide paths from directory listings, separated by `,`
-a, --auth <rule>... Add auth for path
--auth-method <value> Select auth method [default: digest] [possible values: basic, digest]
-A, --allow-all Allow all operations

View file

@ -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<String> = 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