parseopt.go 458 B

1234567891011121314151617181920212223
  1. package tagflag
  2. type parseOpt func(p *parser)
  3. // Don't perform default behaviour if -h or -help are passed.
  4. func NoDefaultHelp() parseOpt {
  5. return func(p *parser) {
  6. p.noDefaultHelp = true
  7. }
  8. }
  9. // Provides a description for the program to be shown in the usage message.
  10. func Description(desc string) parseOpt {
  11. return func(p *parser) {
  12. p.description = desc
  13. }
  14. }
  15. func Program(name string) parseOpt {
  16. return func(p *parser) {
  17. p.program = name
  18. }
  19. }