Cleanup: Clean previous commit.

Dislike the idea of passing a string into build_cli. By removing
a call to default_value we can side-step the problem.

Downside is we lose the error log if a user provides a bad depth
This commit is contained in:
andy.boot
2022-08-22 17:46:10 +01:00
parent f60184ecbb
commit b9b2aee760
3 changed files with 4 additions and 9 deletions
+1 -2
View File
@@ -1,6 +1,6 @@
use clap::{Arg, Command};
pub fn build_cli(max_depth: &str) -> Command {
pub fn build_cli() -> Command<'static> {
Command::new("Dust")
.about("Like du but more intuitive")
.version(env!("CARGO_PKG_VERSION"))
@@ -11,7 +11,6 @@ pub fn build_cli(max_depth: &str) -> Command {
.long("depth")
.help("Depth to show")
.takes_value(true)
.default_value(max_depth)
)
.arg(
Arg::new("number_of_lines")