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

Wrapping --help output lines to 80 (or whatever) characters #810

Open
farnasirim opened this issue Jan 15, 2019 · 3 comments
Open

Wrapping --help output lines to 80 (or whatever) characters #810

farnasirim opened this issue Jan 15, 2019 · 3 comments
Labels
kind/feature A feature request for cobra; new or enhanced behavior lifecycle/needs-pr Ready for a PR from the community

Comments

@farnasirim
Copy link

      --smtp-server-host string   SMTP server host address to use for sending emails. Default: smtp.gmail.com                                                            
      --smtp-to string            Address to send the diff email to. Defaults to smtp-user

I had a look around the code and figured that this is not supported. Was wondering if you would accept a patch.

This is not very trivial to do right now as the padding that comes before the command descriptions is dependent on the longest flag name + type and calculating the padding and repadding subsequent lines is cumbersome for the user.

Therefore I think it makes more sense to handle this inside cobra.

@github-actions
Copy link

github-actions bot commented Apr 7, 2020

This issue is being marked as stale due to a long period of inactivity

@johnSchnake
Copy link
Collaborator

Having worked on a few different tools I agree that the general text-wrapping problem is frustrating for every dev to handle and if cobra could do it for the help/usage it would make a lot of sense.

The main issue is that there are lots of different approaches/libraries that help so it may be a bit opinionated. Open to a PR for sure though.

@johnSchnake johnSchnake added kind/feature A feature request for cobra; new or enhanced behavior lifecycle/needs-pr Ready for a PR from the community and removed kind/stale labels Feb 25, 2022
@znewman01
Copy link

kubectl has a printer here that might be a useful starting point: kubernetes/kubernetes#104736

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
kind/feature A feature request for cobra; new or enhanced behavior lifecycle/needs-pr Ready for a PR from the community
Projects
None yet
Development

No branches or pull requests

3 participants