go-options

module
v0.0.0-...-aeb6c29 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: May 28, 2022 License: MIT

README

go-options - command line parsing library for Go

  • Easy to use - no boilerplate
  • Self-documenting - the spec turns into the usage string
  • Powerful - doesn't do everything you ever dreamed of, but comes close
  • Flexible - if you want control over parsing, provide your own callback.

This design is inspired by git rev-parse --parseopt and the discussion of bup.options here. There are some minor deviations.

  • On the code side, you must access the opt structure with canonical option names only. This is intended to reduce programmer errors. (This applies to the simple, non-callback interface.)
  • When I support negated options, I will not support unnegated aliases for them as that can lead to more confusion than I deem worth harboring.

Install

go get github.com/gaal/go-options/options
This package is distributed under the MIT/X license.

Documentation

godoc github.com/gaal/go-options/options

Contact

Gaal Yahas, gaal@forum2.org.

Directories

Path Synopsis
example
ex1
Example use of the options library, using opt/flags/extra style.
Example use of the options library, using opt/flags/extra style.
ex2
Example use of the options library, using callback/static style.
Example use of the options library, using callback/static style.
Package options provides a command line option parser.
Package options provides a command line option parser.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL