Compact help should display full command.
This commit is contained in:
@@ -23,7 +23,8 @@ var cli struct {
|
|||||||
}
|
}
|
||||||
|
|
||||||
func main() {
|
func main() {
|
||||||
cmd := kong.Parse(&cli, kong.Description("A shell-like example app."), kong.HelpOptions(kong.CompactHelp()))
|
cmd := kong.Parse(&cli, kong.Description("A shell-like example app."),
|
||||||
|
kong.HelpOptions(kong.CompactHelp()))
|
||||||
switch cmd {
|
switch cmd {
|
||||||
case "rm <paths>":
|
case "rm <paths>":
|
||||||
fmt.Println(cli.Rm.Paths, cli.Rm.Force, cli.Rm.Recursive)
|
fmt.Println(cli.Rm.Paths, cli.Rm.Force, cli.Rm.Recursive)
|
||||||
|
|||||||
@@ -78,7 +78,7 @@ func printNodeDetail(w *helpWriter, node *Node) {
|
|||||||
if w.options.compact {
|
if w.options.compact {
|
||||||
rows := [][2]string{}
|
rows := [][2]string{}
|
||||||
for _, cmd := range cmds {
|
for _, cmd := range cmds {
|
||||||
rows = append(rows, [2]string{cmd.Name, cmd.Help})
|
rows = append(rows, [2]string{cmd.Path(), cmd.Help})
|
||||||
}
|
}
|
||||||
writeTwoColumns(iw, defaultColumnPadding, rows)
|
writeTwoColumns(iw, defaultColumnPadding, rows)
|
||||||
} else {
|
} else {
|
||||||
|
|||||||
Reference in New Issue
Block a user