Skip to content

Commit

Permalink
fix: apply PR comments
Browse files Browse the repository at this point in the history
  • Loading branch information
Will-Shanks committed Jan 29, 2024
1 parent 29c5690 commit e6acc7b
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 6 deletions.
6 changes: 3 additions & 3 deletions clap_mangen/src/render.rs
Original file line number Diff line number Diff line change
Expand Up @@ -9,10 +9,10 @@ pub(crate) fn subcommand_heading(cmd: &clap::Command) -> &str {
}

pub(crate) fn about(roff: &mut Roff, cmd: &clap::Command) {
let name = cmd.get_display_name().unwrap_or_else(|| cmd.get_name()).to_string();
let name = cmd.get_display_name().unwrap_or_else(|| cmd.get_name());
let s = match cmd.get_about().or_else(|| cmd.get_long_about()) {
Some(about) => format!("{} - {}", name, about),
None => name,
None => name.to_owned(),
};
roff.text([roman(s)]);
}
Expand All @@ -30,7 +30,7 @@ pub(crate) fn description(roff: &mut Roff, cmd: &clap::Command) {
}

pub(crate) fn synopsis(roff: &mut Roff, cmd: &clap::Command) {
let name = cmd.clone().render_usage().to_string();
let name = cmd.get_bin_name().unwrap_or_else(|| cmd.get_name());
let mut line = vec![bold(name), roman(" ")];

for opt in cmd.get_arguments().filter(|i| !i.is_hide_set()) {
Expand Down
6 changes: 3 additions & 3 deletions clap_mangen/tests/snapshots/sub_subcommand_help.roff
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
.ie /n(.g .ds Aq /(aq
.el .ds Aq '
.TH help 1 "help "
.TH my-app-help 1 "help "
.SH NAME
help /- Print this message or the help of the given subcommand(s)
my/-app/-help /- Print this message or the help of the given subcommand(s)
.SH SYNOPSIS
/fBhelp/fR [/fIsubcommands/fR]
/fBmy/-app help/fR [/fIsubcommands/fR]
.SH DESCRIPTION
Print this message or the help of the given subcommand(s)
.SH SUBCOMMANDS
Expand Down

0 comments on commit e6acc7b

Please sign in to comment.