aboutsummaryrefslogtreecommitdiff
path: root/src/framework
diff options
context:
space:
mode:
authorLakelezz <[email protected]>2018-09-14 17:07:51 +0200
committerGitHub <[email protected]>2018-09-14 17:07:51 +0200
commit4778e6940131e97691f5e1e3d04a28480a9066cc (patch)
tree5274c928a43a12df41af6230fd3cf826b8588c92 /src/framework
parentAdd `Usage Sample`-field back to help. (#388) (diff)
downloadserenity-4778e6940131e97691f5e1e3d04a28480a9066cc.tar.xz
serenity-4778e6940131e97691f5e1e3d04a28480a9066cc.zip
Check if a group is empty and exclude them if that's the case. (#389)
Diffstat (limited to 'src/framework')
-rw-r--r--src/framework/standard/help_commands.rs14
1 files changed, 9 insertions, 5 deletions
diff --git a/src/framework/standard/help_commands.rs b/src/framework/standard/help_commands.rs
index 4953b21..ca8fdc6 100644
--- a/src/framework/standard/help_commands.rs
+++ b/src/framework/standard/help_commands.rs
@@ -489,7 +489,9 @@ fn create_command_group_commands_pair_from_groups<'a, H: BuildHasher>(
&help_options,
);
- listed_groups.push(group_with_cmds);
+ if !group_with_cmds.command_names.is_empty() {
+ listed_groups.push(group_with_cmds);
+ }
}
listed_groups
@@ -553,10 +555,12 @@ pub fn create_customised_help_data<'a, H: BuildHasher>(
&help_options
);
- return CustomisedHelpData::GroupedCommands {
- help_description: group.description.clone().unwrap_or_default(),
- groups: vec![single_group],
- };
+ if !single_group.command_names.is_empty() {
+ return CustomisedHelpData::GroupedCommands {
+ help_description: group.description.clone().unwrap_or_default(),
+ groups: vec![single_group],
+ };
+ }
}
}