Skip to content

Commit

Permalink
fix(clap_mangen): Use italic for replaceble args
Browse files Browse the repository at this point in the history
  • Loading branch information
ducaale committed Apr 3, 2022
1 parent 99d6737 commit fbfeaab
Show file tree
Hide file tree
Showing 6 changed files with 17 additions and 17 deletions.
8 changes: 4 additions & 4 deletions clap_mangen/src/render.rs
Original file line number Diff line number Diff line change
Expand Up @@ -62,9 +62,9 @@ pub(crate) fn synopsis(roff: &mut Roff, cmd: &clap::Command) {
let (lhs, rhs) = option_markers(arg);
line.push(roman(lhs));
if let Some(value) = arg.get_value_names() {
line.push(bold(value.join(" ")));
line.push(italic(value.join(" ")));
} else {
line.push(bold(arg.get_id()));
line.push(italic(arg.get_id()));
}
line.push(roman(rhs));
line.push(roman(" "));
Expand Down Expand Up @@ -126,9 +126,9 @@ pub(crate) fn options(roff: &mut Roff, cmd: &clap::Command) {
let (lhs, rhs) = option_markers(pos);
header.push(roman(lhs));
if let Some(value) = pos.get_value_names() {
header.push(bold(value.join(" ")));
header.push(italic(value.join(" ")));
} else {
header.push(bold(pos.get_id()));
header.push(italic(pos.get_id()));
};
header.push(roman(rhs));

Expand Down
4 changes: 2 additions & 2 deletions clap_mangen/tests/snapshots/aliases.bash.roff
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
.SH NAME
my/-app /- testing bash completions
.SH SYNOPSIS
/fBmy/-app/fR [/fB/-h/fR|/fB/-/-help/fR] [/fB/-V/fR|/fB/-/-version/fR] [/fB/-f/fR|/fB/-/-flag/fR] [/fB/-o/fR|/fB/-/-option/fR] [/fBpositional/fR]
/fBmy/-app/fR [/fB/-h/fR|/fB/-/-help/fR] [/fB/-V/fR|/fB/-/-version/fR] [/fB/-f/fR|/fB/-/-flag/fR] [/fB/-o/fR|/fB/-/-option/fR] [/fIpositional/fR]
.SH DESCRIPTION
testing bash completions
.SH OPTIONS
Expand All @@ -21,7 +21,7 @@ cmd flag
/fB/-o/fR, /fB/-/-option/fR
cmd option
.TP
[/fBpositional/fR]
[/fIpositional/fR]

.SH VERSION
v3.0
6 changes: 3 additions & 3 deletions clap_mangen/tests/snapshots/feature_sample.bash.roff
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
.SH NAME
my/-app /- Tests completions
.SH SYNOPSIS
/fBmy/-app/fR [/fB/-h/fR|/fB/-/-help/fR] [/fB/-V/fR|/fB/-/-version/fR] [/fB/-c/fR|/fB/-/-config/fR] [/fBfile/fR] [/fBchoice/fR] [/fIsubcommands/fR]
/fBmy/-app/fR [/fB/-h/fR|/fB/-/-help/fR] [/fB/-V/fR|/fB/-/-version/fR] [/fB/-c/fR|/fB/-/-config/fR] [/fIfile/fR] [/fIchoice/fR] [/fIsubcommands/fR]
.SH DESCRIPTION
Tests completions
.SH OPTIONS
Expand All @@ -18,10 +18,10 @@ Print version information
/fB/-c/fR, /fB/-/-config/fR
some config file
.TP
[/fBfile/fR]
[/fIfile/fR]
some input file
.TP
[/fBchoice/fR]
[/fIchoice/fR]

.SH SUBCOMMANDS
.TP
Expand Down
6 changes: 3 additions & 3 deletions clap_mangen/tests/snapshots/special_commands.bash.roff
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
.SH NAME
my/-app /- Tests completions
.SH SYNOPSIS
/fBmy/-app/fR [/fB/-h/fR|/fB/-/-help/fR] [/fB/-V/fR|/fB/-/-version/fR] [/fB/-c/fR|/fB/-/-config/fR] [/fBfile/fR] [/fBchoice/fR] [/fIsubcommands/fR]
/fBmy/-app/fR [/fB/-h/fR|/fB/-/-help/fR] [/fB/-V/fR|/fB/-/-version/fR] [/fB/-c/fR|/fB/-/-config/fR] [/fIfile/fR] [/fIchoice/fR] [/fIsubcommands/fR]
.SH DESCRIPTION
Tests completions
.SH OPTIONS
Expand All @@ -18,10 +18,10 @@ Print version information
/fB/-c/fR, /fB/-/-config/fR
some config file
.TP
[/fBfile/fR]
[/fIfile/fR]
some input file
.TP
[/fBchoice/fR]
[/fIchoice/fR]

.SH SUBCOMMANDS
.TP
Expand Down
6 changes: 3 additions & 3 deletions clap_mangen/tests/snapshots/sub_subcommands.bash.roff
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
.SH NAME
my/-app /- Tests completions
.SH SYNOPSIS
/fBmy/-app/fR [/fB/-h/fR|/fB/-/-help/fR] [/fB/-V/fR|/fB/-/-version/fR] [/fB/-c/fR|/fB/-/-config/fR] [/fBfile/fR] [/fBchoice/fR] [/fIsubcommands/fR]
/fBmy/-app/fR [/fB/-h/fR|/fB/-/-help/fR] [/fB/-V/fR|/fB/-/-version/fR] [/fB/-c/fR|/fB/-/-config/fR] [/fIfile/fR] [/fIchoice/fR] [/fIsubcommands/fR]
.SH DESCRIPTION
Tests completions
.SH OPTIONS
Expand All @@ -18,10 +18,10 @@ Print version information
/fB/-c/fR, /fB/-/-config/fR
some config file
.TP
[/fBfile/fR]
[/fIfile/fR]
some input file
.TP
[/fBchoice/fR]
[/fIchoice/fR]

.SH SUBCOMMANDS
.TP
Expand Down
4 changes: 2 additions & 2 deletions clap_mangen/tests/snapshots/value_hint.bash.roff
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
.SH NAME
my/-app
.SH SYNOPSIS
/fBmy/-app/fR [/fB/-/-help/fR] [/fB/-/-choice/fR] [/fB/-/-unknown/fR] [/fB/-/-other/fR] [/fB/-p/fR|/fB/-/-path/fR] [/fB/-f/fR|/fB/-/-file/fR] [/fB/-d/fR|/fB/-/-dir/fR] [/fB/-e/fR|/fB/-/-exe/fR] [/fB/-/-cmd/-name/fR] [/fB/-c/fR|/fB/-/-cmd/fR] [/fB/-u/fR|/fB/-/-user/fR] [/fB/-h/fR|/fB/-/-host/fR] [/fB/-/-url/fR] [/fB/-/-email/fR] [/fBcommand_with_args/fR]
/fBmy/-app/fR [/fB/-/-help/fR] [/fB/-/-choice/fR] [/fB/-/-unknown/fR] [/fB/-/-other/fR] [/fB/-p/fR|/fB/-/-path/fR] [/fB/-f/fR|/fB/-/-file/fR] [/fB/-d/fR|/fB/-/-dir/fR] [/fB/-e/fR|/fB/-/-exe/fR] [/fB/-/-cmd/-name/fR] [/fB/-c/fR|/fB/-/-cmd/fR] [/fB/-u/fR|/fB/-/-user/fR] [/fB/-h/fR|/fB/-/-host/fR] [/fB/-/-url/fR] [/fB/-/-email/fR] [/fIcommand_with_args/fR]
.SH DESCRIPTION
.SH OPTIONS
.TP
Expand Down Expand Up @@ -50,5 +50,5 @@ Print help information
/fB/-/-email/fR

.TP
[/fBcommand_with_args/fR]
[/fIcommand_with_args/fR]

0 comments on commit fbfeaab

Please sign in to comment.