Skip to content
New issue

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

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

Already on GitHub? # to your account

In the generated help, hidden groups are still counted for alignment #278

Closed
chipaca opened this issue Oct 1, 2018 · 0 comments
Closed

Comments

@chipaca
Copy link
Contributor

chipaca commented Oct 1, 2018

Given

package main

import "os"
import "github.com/jessevdk/go-flags"

type group struct {
	M bool `long:"a-very-long-option-name" description:"cue 'long long man' song"`
}

type options struct {
	A bool  `short:"a" description:"output should be aligned"`
	G group `group:"Group" hidden:"yes"`
	Z bool  `short:"z" description:"operator is asleep"`
}

func main() { flags.NewParser(&options{}, 0).WriteHelp(os.Stdout) }

you get

Usage:
  bug4

Application Options:
  -a                             output should be aligned
  -z                             operator is asleep
# for free to join this conversation on GitHub. Already have an account? # to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant