diff --git a/src/config.rs b/src/config.rs index 8e51980535..23a04ed79a 100644 --- a/src/config.rs +++ b/src/config.rs @@ -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"; @@ -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"), ) @@ -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)) diff --git a/tests/recipe_exists.rs b/tests/if_present.rs similarity index 86% rename from tests/recipe_exists.rs rename to tests/if_present.rs index dc727c6f98..32054a29da 100644 --- a/tests/recipe_exists.rs +++ b/tests/if_present.rs @@ -1,7 +1,7 @@ use super::*; #[test] -fn without_recipe_exists() { +fn without_if_present() { Test::new() .arg("execute") .justfile( @@ -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: diff --git a/tests/lib.rs b/tests/lib.rs index 9fdcd789cf..2576e78289 100644 --- a/tests/lib.rs +++ b/tests/lib.rs @@ -64,6 +64,7 @@ mod functions; #[cfg(unix)] mod global; mod groups; +mod if_present; mod ignore_comments; mod imports; mod init; @@ -91,7 +92,6 @@ mod private; mod quiet; mod quote; mod readme; -mod recipe_exists; mod recursion_limit; mod regexes; mod run;