From f5c0aefd8e9e6809efb45aa9e661e0ce175e8677 Mon Sep 17 00:00:00 2001 From: sigoden Date: Tue, 30 May 2023 16:49:16 +0800 Subject: [PATCH] refactor: cli positional rename root => SERVE_PATH(#215) --- src/args.rs | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/args.rs b/src/args.rs index 48c9afa..7cb3b37 100644 --- a/src/args.rs +++ b/src/args.rs @@ -25,8 +25,8 @@ pub fn build_cli() -> Command { env!("CARGO_PKG_REPOSITORY") )) .arg( - Arg::new("root") - .env("DUFS_ROOT") + Arg::new("serve_path") + .env("DUFS_SERVE_PATH") .hide_env(true) .default_value(".") .value_parser(value_parser!(PathBuf)) @@ -264,7 +264,7 @@ impl Args { .map(|bind| bind.map(|v| v.as_str()).collect()) .unwrap_or_else(|| vec!["0.0.0.0", "::"]); let addrs: Vec = Args::parse_addrs(&addrs)?; - let path = Args::parse_path(matches.get_one::("root").unwrap())?; + let path = Args::parse_path(matches.get_one::("serve_path").unwrap())?; let path_is_file = path.metadata()?.is_file(); let path_prefix = matches .get_one::("path-prefix")