]> OzVa Git service - ozva-cloud/commitdiff
chore: undo hidden arg changes
authorsigoden <sigoden@gmail.com>
Fri, 9 Sep 2022 13:30:27 +0000 (21:30 +0800)
committersigoden <sigoden@gmail.com>
Fri, 9 Sep 2022 13:30:27 +0000 (21:30 +0800)
README.md
src/args.rs

index 6b79b39333fdf915155b353702e84fea34faa8b4..71fc0c9f022d6c12b2021ffd49ab9bdefbb748b3 100644 (file)
--- a/README.md
+++ b/README.md
@@ -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
index 2eb382ce0291c19e6902070f9d6ab83a9c19d568..358a23eceb30b7479a7eb1cf1836773e79ee35f1 100644 (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