Skip to content

Commit

Permalink
Renamed recipe-exists to if-present
Browse files Browse the repository at this point in the history
  • Loading branch information
R3ZV committed Nov 11, 2024
1 parent ed08e7a commit 9e9862f
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 8 deletions.
10 changes: 5 additions & 5 deletions src/config.rs
Original file line number Diff line number Diff line change
Expand Up @@ -103,7 +103,7 @@ mod arg {
pub(crate) const NO_HIGHLIGHT: &str = "NO-HIGHLIGHT";
pub(crate) const ONE: &str = "ONE";
pub(crate) const QUIET: &str = "QUIET";
pub(crate) const RECIPE_EXISTS: &str = "RECIPE-EXISTS";
pub(crate) const IF_PRESENT: &str = "IF-PRESENT";
pub(crate) const SET: &str = "SET";
pub(crate) const SHELL: &str = "SHELL";
pub(crate) const SHELL_ARG: &str = "SHELL-ARG";
Expand Down Expand Up @@ -317,9 +317,9 @@ impl Config {
.conflicts_with(arg::DRY_RUN),
)
.arg(
Arg::new(arg::RECIPE_EXISTS)
.long("recipe-exists")
.env("JUST_RECIPE_EXISTS")
Arg::new(arg::IF_PRESENT)
.long("if-present")
.env("JUST_IF_PRESENT")
.action(ArgAction::SetTrue)
.help("Suppress error code"),
)
Expand Down Expand Up @@ -759,7 +759,7 @@ impl Config {
unstable,
verbosity: if matches.get_flag(arg::QUIET) {
Verbosity::Quiet
} else if matches.get_flag(arg::RECIPE_EXISTS) {
} else if matches.get_flag(arg::IF_PRESENT) {
Verbosity::RecipeQuiet
} else {
Verbosity::from_flag_occurrences(matches.get_count(arg::VERBOSE))
Expand Down
4 changes: 2 additions & 2 deletions tests/recipe_exists.rs → tests/if_present.rs
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
use super::*;

#[test]
fn without_recipe_exists() {
fn without_if_present() {
Test::new()
.arg("execute")
.justfile(
Expand All @@ -19,7 +19,7 @@ fn without_recipe_exists() {
#[test]
fn ignore_unknown_recipe() {
Test::new()
.args(["--recipe-exists", "execute"])
.args(["--if-present", "execute"])
.justfile(
"
build:
Expand Down
2 changes: 1 addition & 1 deletion tests/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -64,6 +64,7 @@ mod functions;
#[cfg(unix)]
mod global;
mod groups;
mod if_present;
mod ignore_comments;
mod imports;
mod init;
Expand Down Expand Up @@ -91,7 +92,6 @@ mod private;
mod quiet;
mod quote;
mod readme;
mod recipe_exists;
mod recursion_limit;
mod regexes;
mod run;
Expand Down

0 comments on commit 9e9862f

Please sign in to comment.