refactor: cli positional rename root => SERVE_PATH(#215)
This commit is contained in:
parent
8a1e7674df
commit
f5c0aefd8e
1 changed files with 3 additions and 3 deletions
|
@ -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<BindAddr> = Args::parse_addrs(&addrs)?;
|
||||
let path = Args::parse_path(matches.get_one::<PathBuf>("root").unwrap())?;
|
||||
let path = Args::parse_path(matches.get_one::<PathBuf>("serve_path").unwrap())?;
|
||||
let path_is_file = path.metadata()?.is_file();
|
||||
let path_prefix = matches
|
||||
.get_one::<String>("path-prefix")
|
||||
|
|
Loading…
Reference in a new issue