1
1
mirror of https://github.com/casey/just.git synced 2024-08-16 01:10:37 +03:00

Use default values for --list-heading and --list-prefix (#2213)

This commit is contained in:
Casey Rodarmor 2024-06-30 14:14:39 -07:00 committed by GitHub
parent 208187fbb6
commit 39b2783c4b
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

View File

@ -236,6 +236,7 @@ impl Config {
.env("JUST_LIST_HEADING")
.help("Print <TEXT> 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 <TEXT> 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::<String>(arg::LIST_HEADING)
.map_or_else(|| "Available recipes:\n".into(), Into::into),
list_prefix: matches
.get_one::<String>(arg::LIST_PREFIX)
.map_or_else(|| " ".into(), Into::into),
list_heading: matches.get_one::<String>(arg::LIST_HEADING).unwrap().into(),
list_prefix: matches.get_one::<String>(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),