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")
|
env!("CARGO_PKG_REPOSITORY")
|
||||||
))
|
))
|
||||||
.arg(
|
.arg(
|
||||||
Arg::new("root")
|
Arg::new("serve_path")
|
||||||
.env("DUFS_ROOT")
|
.env("DUFS_SERVE_PATH")
|
||||||
.hide_env(true)
|
.hide_env(true)
|
||||||
.default_value(".")
|
.default_value(".")
|
||||||
.value_parser(value_parser!(PathBuf))
|
.value_parser(value_parser!(PathBuf))
|
||||||
|
@ -264,7 +264,7 @@ impl Args {
|
||||||
.map(|bind| bind.map(|v| v.as_str()).collect())
|
.map(|bind| bind.map(|v| v.as_str()).collect())
|
||||||
.unwrap_or_else(|| vec!["0.0.0.0", "::"]);
|
.unwrap_or_else(|| vec!["0.0.0.0", "::"]);
|
||||||
let addrs: Vec<BindAddr> = Args::parse_addrs(&addrs)?;
|
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_is_file = path.metadata()?.is_file();
|
||||||
let path_prefix = matches
|
let path_prefix = matches
|
||||||
.get_one::<String>("path-prefix")
|
.get_one::<String>("path-prefix")
|
||||||
|
|
Loading…
Reference in a new issue