Skip to content

Commit

Permalink
Remove (no group) header before ungrouped recipes (#2268)
Browse files Browse the repository at this point in the history
  • Loading branch information
casey authored Jul 21, 2024
1 parent 16aad6e commit 980af41
Show file tree
Hide file tree
Showing 4 changed files with 3 additions and 15 deletions.
5 changes: 1 addition & 4 deletions src/subcommand.rs
Original file line number Diff line number Diff line change
Expand Up @@ -575,11 +575,8 @@ impl Subcommand {
}

if !no_groups {
print!("{list_prefix}");
if let Some(group) = &group {
println!("[{group}]");
} else {
println!("(no group)");
println!("{list_prefix}[{group}]");
}
}

Expand Down
3 changes: 0 additions & 3 deletions tests/groups.rs
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,6 @@ fn list_with_groups() {
.stdout(
"
Available recipes:
(no group)
c
[alpha]
Expand Down Expand Up @@ -76,7 +75,6 @@ fn list_with_groups_unsorted() {
.stdout(
"
Available recipes:
(no group)
c
[alpha]
Expand Down Expand Up @@ -118,7 +116,6 @@ fn list_with_groups_unsorted_group_order() {
.stdout(
"
Available recipes:
(no group)
c
[x]
Expand Down
2 changes: 0 additions & 2 deletions tests/list.rs
Original file line number Diff line number Diff line change
Expand Up @@ -236,7 +236,6 @@ fn list_with_groups_in_modules() {
.stdout(
"
Available recipes:
(no group)
bar:
[BAZ]
baz
Expand Down Expand Up @@ -412,7 +411,6 @@ fn submodules_without_groups() {
.stdout(
"
Available recipes:
(no group)
foo ...
[baz]
Expand Down
8 changes: 2 additions & 6 deletions tests/modules.rs
Original file line number Diff line number Diff line change
Expand Up @@ -802,14 +802,13 @@ fn group_attribute_on_module() {
.stdout(
"
Available recipes:
(no group)
c
[alpha]
a
foo ...
zee ...
[beta]
b
bar ...
Expand Down Expand Up @@ -850,14 +849,13 @@ fn group_attribute_on_module_unsorted() {
.stdout(
"
Available recipes:
(no group)
c
[alpha]
a
zee ...
foo ...
[beta]
b
bar ...
Expand Down Expand Up @@ -898,7 +896,6 @@ fn group_attribute_on_module_list_submodule() {
.stdout(
"
Available recipes:
(no group)
c
[alpha]
Expand Down Expand Up @@ -950,7 +947,6 @@ fn group_attribute_on_module_list_submodule_unsorted() {
.stdout(
"
Available recipes:
(no group)
c
[alpha]
Expand Down

0 comments on commit 980af41

Please sign in to comment.