imp(subcommands): "SUBCOMMANDS" label affected by subcommand placeholder
@@ -750,7 +750,18 @@ impl<'b, 'c, 'd, 'w> Help<'b, 'c, 'd, 'w> {
if !first {
self.none("\n\n")?;
}
- self.warning("SUBCOMMANDS:\n")?;
+
+ let subcommand_string = self.parser.app.subcommand_placeholder.unwrap_or("SUBCOMMAND");
+ self.warning(subcommand_string)?;
+ // TODO: simply appending an 's' doesn't work for every string.
+ let pluralizer = if subcommand_string.chars().last().unwrap_or('D').is_lowercase() {
+ "s"
+ } else {
+ "S"
+ };
+ self.warning(pluralizer)?;
+ self.warning(":\n")?;
+
self.write_subcommands(&self.parser.app)?;
}
