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
+2 -5
View File
@@ -90,7 +90,7 @@ fn get_regex_value(maybe_value: Option<Values>) -> Vec<Regex> {
}
fn main() {
let options = build_cli(&usize::MAX.to_string()).get_matches();
let options = build_cli().get_matches();
let config = get_config();
@@ -108,10 +108,7 @@ fn main() {
.value_of_t("width")
.unwrap_or_else(|_| get_width_of_terminal());
let depth = options.value_of_t("depth").unwrap_or_else(|_| {
eprintln!("Ignoring bad value for depth");
usize::MAX
});
let depth = options.value_of_t("depth").unwrap_or(usize::MAX);
// If depth is set, then we set the default number_of_lines to be max
// instead of screen height