cli
cli copied to clipboard
include a newline between different categories
What type of PR is this?
- bug
What this PR does / why we need it:
The docs show a newline between categories in the default help output. This change adds the newline and makes the actual output consistent with documentation.
Which issue(s) this PR fixes:
N/A
Special notes for your reviewer:
Appreciate your work!
Testing
Using the example:
package main
import (
"context"
"log"
"os"
"github.com/urfave/cli/v3"
)
func main() {
app := &cli.Command{
Commands: []*cli.Command{
{
Name: "noop",
},
{
Name: "add",
Category: "template",
},
{
Name: "remove",
Category: "template",
},
},
}
if err := app.Run(context.Background(), os.Args); err != nil {
log.Fatal(err)
}
}
Diff:
diff --git a/before b/after
index b89e493..498ee0e 100644
--- a/before
+++ b/after
@@ -7,6 +7,7 @@ USAGE:
COMMANDS:
noop
help, h Shows a list of commands or help for one command
+
template:
add
remove
Release Notes
Add a newline between command categories.
What's the best way to get this ported to v2 as well?
@abennett You have a raise a PR against v2 as well. Can you fix the failing tests here ?
@abennett You have a raise a PR against v2 as well. Can you fix the failing tests here ?
I can definitely create another PR. 👍
Uploading to codecov caused the failure. I could reattempt.