Skip to content

Commit

Permalink
Use default values for --list-heading and --list-prefix (#2213)
Browse files Browse the repository at this point in the history
  • Loading branch information
casey authored Jun 30, 2024
1 parent 208187f commit 39b2783
Showing 1 changed file with 4 additions and 6 deletions.
10 changes: 4 additions & 6 deletions src/config.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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(
Expand All @@ -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(
Expand Down Expand Up @@ -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),
Expand Down

0 comments on commit 39b2783

Please sign in to comment.