Skip to content

Commit

Permalink
test(mangen): Add all flatten related tests from builder
Browse files Browse the repository at this point in the history
Add all tests from tests/builder/help.rs to mangen, too.

Signed-off-by: Paul Spooren <[email protected]>
  • Loading branch information
aparcar committed Oct 23, 2024
1 parent e19c5b5 commit 004e815
Show file tree
Hide file tree
Showing 13 changed files with 653 additions and 0 deletions.
27 changes: 27 additions & 0 deletions clap_mangen/tests/snapshots/flatten_arg_required.roff
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
.ie \n(.g .ds Aq \(aq
.el .ds Aq '
.TH parent 1 "parent "
.SH NAME
parent \- parent command
.SH SYNOPSIS
\fBparent\fR <\fB\-\-parent\fR> [\fB\-h\fR|\fB\-\-help\fR]
.br
\fBparent test\fR <\fB\-\-child\fR> [\fB\-h\fR|\fB\-\-help\fR]
.br
\fBparent help\fR
.SH DESCRIPTION
parent command
.SH OPTIONS
.TP
\fB\-\-parent\fR

.TP
\fB\-h\fR, \fB\-\-help\fR
Print help
.SH SUBCOMMANDS
.TP
\fBtest\fR <\fB\-\-child\fR> [\fB\-h\fR|\fB\-\-help\fR]
test command
.TP
\fBhelp\fR
Print this message or the help of the given subcommand(s)
27 changes: 27 additions & 0 deletions clap_mangen/tests/snapshots/flatten_basic.roff
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
.ie \n(.g .ds Aq \(aq
.el .ds Aq '
.TH parent 1 "parent "
.SH NAME
parent \- parent command
.SH SYNOPSIS
\fBparent\fR [\fB\-\-parent\fR] [\fB\-h\fR|\fB\-\-help\fR]
.br
\fBparent test\fR [\fB\-\-child\fR] [\fB\-h\fR|\fB\-\-help\fR]
.br
\fBparent help\fR
.SH DESCRIPTION
parent command
.SH OPTIONS
.TP
\fB\-\-parent\fR

.TP
\fB\-h\fR, \fB\-\-help\fR
Print help
.SH SUBCOMMANDS
.TP
\fBtest\fR [\fB\-\-child\fR] [\fB\-h\fR|\fB\-\-help\fR]
test command
.TP
\fBhelp\fR
Print this message or the help of the given subcommand(s)
27 changes: 27 additions & 0 deletions clap_mangen/tests/snapshots/flatten_help_cmd.roff
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
.ie \n(.g .ds Aq \(aq
.el .ds Aq '
.TH parent 1 "parent "
.SH NAME
parent \- parent command
.SH SYNOPSIS
\fBparent\fR [\fB\-\-parent\fR] [\fB\-h\fR|\fB\-\-help\fR]
.br
\fBparent test\fR [\fB\-\-child\fR] [\fB\-h\fR|\fB\-\-help\fR]
.br
\fBparent help\fR
.SH DESCRIPTION
parent command
.SH OPTIONS
.TP
\fB\-\-parent\fR
bar
.TP
\fB\-h\fR, \fB\-\-help\fR
Print help (see a summary with \*(Aq\-h\*(Aq)
.SH SUBCOMMANDS
.TP
\fBtest\fR [\fB\-\-child\fR] [\fB\-h\fR|\fB\-\-help\fR]
long some
.TP
\fBhelp\fR
Print this message or the help of the given subcommand(s)
34 changes: 34 additions & 0 deletions clap_mangen/tests/snapshots/flatten_hidden_command.roff
Original file line number Diff line number Diff line change
@@ -0,0 +1,34 @@
.ie \n(.g .ds Aq \(aq
.el .ds Aq '
.TH parent 1 "parent "
.SH NAME
parent \- parent command
.SH SYNOPSIS
\fBparent\fR [\fB\-\-parent\fR] [\fB\-h\fR|\fB\-\-help\fR]
.br
\fBparent child1\fR [\fB\-\-child1\fR] [\fB\-h\fR|\fB\-\-help\fR]
.br
\fBparent child2\fR [\fB\-\-child2\fR] [\fB\-h\fR|\fB\-\-help\fR]
.br
\fBparent child3\fR [\fB\-\-child3\fR] [\fB\-h\fR|\fB\-\-help\fR]
.br
\fBparent help\fR
.SH DESCRIPTION
parent command
.SH OPTIONS
.TP
\fB\-\-parent\fR

.TP
\fB\-h\fR, \fB\-\-help\fR
Print help
.SH SUBCOMMANDS
.TP
\fBchild1\fR [\fB\-\-child1\fR] [\fB\-h\fR|\fB\-\-help\fR]
child1 command
.TP
\fBchild2\fR [\fB\-\-child2\fR] [\fB\-h\fR|\fB\-\-help\fR]
child2 command
.TP
\fBhelp\fR
Print this message or the help of the given subcommand(s)
37 changes: 37 additions & 0 deletions clap_mangen/tests/snapshots/flatten_not_recursive.roff
Original file line number Diff line number Diff line change
@@ -0,0 +1,37 @@
.ie \n(.g .ds Aq \(aq
.el .ds Aq '
.TH parent 1 "parent "
.SH NAME
parent \- parent command
.SH SYNOPSIS
\fBparent\fR [\fB\-\-parent\fR] [\fB\-h\fR|\fB\-\-help\fR]
.br
\fBparent child1\fR [\fB\-\-child1\fR] [\fB\-h\fR|\fB\-\-help\fR]
.br
\fBparent child2\fR [\fB\-\-child2\fR] [\fB\-h\fR|\fB\-\-help\fR]
.br
\fBparent child3\fR [\fB\-\-child3\fR] [\fB\-h\fR|\fB\-\-help\fR]
.br
\fBparent help\fR
.SH DESCRIPTION
parent command
.SH OPTIONS
.TP
\fB\-\-parent\fR

.TP
\fB\-h\fR, \fB\-\-help\fR
Print help
.SH SUBCOMMANDS
.TP
\fBchild1\fR [\fB\-\-child1\fR] [\fB\-h\fR|\fB\-\-help\fR]
child1 command
.TP
\fBchild2\fR [\fB\-\-child2\fR] [\fB\-h\fR|\fB\-\-help\fR]
child2 command
.TP
\fBchild3\fR [\fB\-\-child3\fR] [\fB\-h\fR|\fB\-\-help\fR]
child3 command
.TP
\fBhelp\fR
Print this message or the help of the given subcommand(s)
34 changes: 34 additions & 0 deletions clap_mangen/tests/snapshots/flatten_recursive.roff
Original file line number Diff line number Diff line change
@@ -0,0 +1,34 @@
.ie \n(.g .ds Aq \(aq
.el .ds Aq '
.TH parent 1 "parent "
.SH NAME
parent \- parent command
.SH SYNOPSIS
\fBparent\fR [\fB\-\-parent\fR] [\fB\-h\fR|\fB\-\-help\fR]
.br
\fBparent child1\fR [\fB\-\-child1\fR] [\fB\-h\fR|\fB\-\-help\fR]
.br
\fBparent child2\fR [\fB\-\-child2\fR] [\fB\-h\fR|\fB\-\-help\fR]
.br
\fBparent child3\fR [\fB\-\-child3\fR] [\fB\-h\fR|\fB\-\-help\fR]
.br
\fBparent help\fR
.SH DESCRIPTION
parent command
.SH OPTIONS
.TP
\fB\-\-parent\fR

.TP
\fB\-h\fR, \fB\-\-help\fR
Print help
.SH SUBCOMMANDS
.TP
\fBchild1\fR [\fB\-\-child1\fR] [\fB\-h\fR|\fB\-\-help\fR]
child1 command
.TP
\fBchild2\fR [\fB\-\-child2\fR] [\fB\-h\fR|\fB\-\-help\fR]
child2 command
.TP
\fBhelp\fR
Print this message or the help of the given subcommand(s)
24 changes: 24 additions & 0 deletions clap_mangen/tests/snapshots/flatten_single_hidden_command.roff
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
.ie \n(.g .ds Aq \(aq
.el .ds Aq '
.TH parent 1 "parent "
.SH NAME
parent \- parent command
.SH SYNOPSIS
\fBparent\fR [\fB\-\-parent\fR] [\fB\-h\fR|\fB\-\-help\fR]
.br
\fBparent child1\fR [\fB\-\-child1\fR] [\fB\-h\fR|\fB\-\-help\fR]
.br
\fBparent help\fR
.SH DESCRIPTION
parent command
.SH OPTIONS
.TP
\fB\-\-parent\fR

.TP
\fB\-h\fR, \fB\-\-help\fR
Print help
.SH SUBCOMMANDS
.TP
\fBhelp\fR
Print this message or the help of the given subcommand(s)
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
.ie \n(.g .ds Aq \(aq
.el .ds Aq '
.TH parent 1 "parent "
.SH NAME
parent \- parent command
.SH SYNOPSIS
\fBparent\fR [\fB\-\-parent\fR] [\fB\-h\fR|\fB\-\-help\fR]
.br
\fBparent test\fR [\fB\-\-child\fR] [\fB\-h\fR|\fB\-\-help\fR]
.br
\fBparent help\fR
.SH DESCRIPTION
parent command
.SH OPTIONS
.TP
\fB\-\-parent\fR

.TP
\fB\-h\fR, \fB\-\-help\fR
Print help
.SH SUBCOMMANDS
.TP
\fBtest\fR [\fB\-\-child\fR] [\fB\-h\fR|\fB\-\-help\fR]
test command
.TP
\fBhelp\fR
Print this message or the help of the given subcommand(s)
27 changes: 27 additions & 0 deletions clap_mangen/tests/snapshots/flatten_with_external_subcommand.roff
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
.ie \n(.g .ds Aq \(aq
.el .ds Aq '
.TH parent 1 "parent "
.SH NAME
parent \- parent command
.SH SYNOPSIS
\fBparent\fR [\fB\-\-parent\fR] [\fB\-h\fR|\fB\-\-help\fR]
.br
\fBparent test\fR [\fB\-\-child\fR] [\fB\-h\fR|\fB\-\-help\fR]
.br
\fBparent help\fR
.SH DESCRIPTION
parent command
.SH OPTIONS
.TP
\fB\-\-parent\fR

.TP
\fB\-h\fR, \fB\-\-help\fR
Print help
.SH SUBCOMMANDS
.TP
\fBtest\fR [\fB\-\-child\fR] [\fB\-h\fR|\fB\-\-help\fR]
test command
.TP
\fBhelp\fR
Print this message or the help of the given subcommand(s)
27 changes: 27 additions & 0 deletions clap_mangen/tests/snapshots/flatten_with_global.roff
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
.ie \n(.g .ds Aq \(aq
.el .ds Aq '
.TH parent 1 "parent "
.SH NAME
parent \- parent command
.SH SYNOPSIS
\fBparent\fR [\fB\-\-parent\fR] [\fB\-h\fR|\fB\-\-help\fR]
.br
\fBparent test\fR [\fB\-\-child\fR] [\fB\-\-parent\fR] [\fB\-h\fR|\fB\-\-help\fR]
.br
\fBparent help\fR
.SH DESCRIPTION
parent command
.SH OPTIONS
.TP
\fB\-\-parent\fR

.TP
\fB\-h\fR, \fB\-\-help\fR
Print help
.SH SUBCOMMANDS
.TP
\fBtest\fR [\fB\-\-child\fR] [\fB\-\-parent\fR] [\fB\-h\fR|\fB\-\-help\fR]
test command
.TP
\fBhelp\fR
Print this message or the help of the given subcommand(s)
25 changes: 25 additions & 0 deletions clap_mangen/tests/snapshots/flatten_with_subcommand_required.roff
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
.ie \n(.g .ds Aq \(aq
.el .ds Aq '
.TH parent 1 "parent "
.SH NAME
parent \- parent command
.SH SYNOPSIS
\fBparent test\fR [\fB\-\-child\fR] [\fB\-h\fR|\fB\-\-help\fR]
.br
\fBparent help\fR
.SH DESCRIPTION
parent command
.SH OPTIONS
.TP
\fB\-\-parent\fR

.TP
\fB\-h\fR, \fB\-\-help\fR
Print help
.SH SUBCOMMANDS
.TP
\fBtest\fR [\fB\-\-child\fR] [\fB\-h\fR|\fB\-\-help\fR]
test command
.TP
\fBhelp\fR
Print this message or the help of the given subcommand(s)
16 changes: 16 additions & 0 deletions clap_mangen/tests/snapshots/flatten_without_subcommands.roff
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
.ie \n(.g .ds Aq \(aq
.el .ds Aq '
.TH parent 1 "parent "
.SH NAME
parent \- parent command
.SH SYNOPSIS
\fBparent\fR [\fB\-\-parent\fR] [\fB\-h\fR|\fB\-\-help\fR]
.SH DESCRIPTION
parent command
.SH OPTIONS
.TP
\fB\-\-parent\fR

.TP
\fB\-h\fR, \fB\-\-help\fR
Print help
Loading

0 comments on commit 004e815

Please sign in to comment.