Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat(mangen): Support flatten_help #5769

Open
wants to merge 4 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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