Skip to content

Commit

Permalink
Make --list-submodules require --list (#2622)
Browse files Browse the repository at this point in the history
  • Loading branch information
casey authored Feb 7, 2025
1 parent 49f282f commit 7c63fb6
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 1 deletion.
2 changes: 1 addition & 1 deletion src/config.rs
Original file line number Diff line number Diff line change
Expand Up @@ -289,7 +289,7 @@ impl Config {
.env("JUST_LIST_SUBMODULES")
.help("List recipes in submodules")
.action(ArgAction::SetTrue)
.env("JUST_LIST_SUBMODULES"),
.requires(cmd::LIST),
)
.arg(
Arg::new(arg::NO_ALIASES)
Expand Down
9 changes: 9 additions & 0 deletions tests/list.rs
Original file line number Diff line number Diff line change
Expand Up @@ -474,3 +474,12 @@ fn unclosed_backticks() {
")
.run();
}

#[test]
fn list_submodules_requires_list() {
Test::new()
.arg("--list-submodules")
.stderr_regex("error: the following required arguments were not provided:\n --list .*")
.status(2)
.run();
}

0 comments on commit 7c63fb6

Please sign in to comment.