From 39b2783c4bcc6be6c2e4a2b3337650d1c590e987 Mon Sep 17 00:00:00 2001 From: Casey Rodarmor Date: Sun, 30 Jun 2024 14:14:39 -0700 Subject: [PATCH] Use default values for `--list-heading` and `--list-prefix` (#2213) --- src/config.rs | 10 ++++------ 1 file changed, 4 insertions(+), 6 deletions(-) diff --git a/src/config.rs b/src/config.rs index 2595c89..51252ba 100644 --- a/src/config.rs +++ b/src/config.rs @@ -236,6 +236,7 @@ impl Config { .env("JUST_LIST_HEADING") .help("Print before list") .value_name("TEXT") + .default_value("Available recipes:\n") .action(ArgAction::Set), ) .arg( @@ -244,6 +245,7 @@ impl Config { .env("JUST_LIST_PREFIX") .help("Print before each list item") .value_name("TEXT") + .default_value(" ") .action(ArgAction::Set), ) .arg( @@ -685,12 +687,8 @@ impl Config { .clone(), highlight: !matches.get_flag(arg::NO_HIGHLIGHT), invocation_directory: env::current_dir().context(config_error::CurrentDirContext)?, - list_heading: matches - .get_one::(arg::LIST_HEADING) - .map_or_else(|| "Available recipes:\n".into(), Into::into), - list_prefix: matches - .get_one::(arg::LIST_PREFIX) - .map_or_else(|| " ".into(), Into::into), + list_heading: matches.get_one::(arg::LIST_HEADING).unwrap().into(), + list_prefix: matches.get_one::(arg::LIST_PREFIX).unwrap().into(), list_submodules: matches.get_flag(arg::LIST_SUBMODULES), load_dotenv: !matches.get_flag(arg::NO_DOTENV), no_aliases: matches.get_flag(arg::NO_ALIASES),