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

include a newline between different categories #1861

Merged
merged 3 commits into from Apr 29, 2024
Merged

Conversation

abennett
Copy link
Contributor

@abennett abennett commented Jan 26, 2024

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.

@abennett
Copy link
Contributor Author

What's the best way to get this ported to v2 as well?

@dearchap
Copy link
Contributor

@abennett You have a raise a PR against v2 as well. Can you fix the failing tests here ?

@abennett
Copy link
Contributor Author

@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.

geofffranks pushed a commit to geofffranks/cli that referenced this pull request Mar 21, 2024
When the wait flag is supplied to run-task, the cli will
not exit until the task enters a terminal state; SUCCEEDED or FAILED.

The cli exits 0 when the task succeeds and exits 1 when the task fails.

This improves the scriptability of tasks. They can be run
serially in a script.

Cherry-pick of 8671a5b (urfave#1861) to v8
Addresses Issue urfave#1104, #2238

Authored-by: Zach Robinson <zrobinson@pivotal.io>

Co-authored-by: Stephan Merker <merker.stephan@gmail.com>
Copy link
Member

@meatballhat meatballhat left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thank you, @abennett!

@meatballhat meatballhat merged commit 6bba9e8 into urfave:main Apr 29, 2024
11 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants