An open API service providing package, version and dependency metadata of many open source software ecosystems and registries.

Top 6.7% on proxy.golang.org
Top 1.4% dependent packages on proxy.golang.org
Top 2.3% dependent repos on proxy.golang.org
Top 2.0% docker downloads on proxy.golang.org

proxy.golang.org : github.com/pborman/options

Package options provides a structured interface for getopt style flag parsing. It is particularly helpful for parsing an option set more than once and possibly concurrently. This package was designed to make option specification simpler and more concise. It is a wrapper around the github.com/pborman/getopt/v2 package. Package options also provides a facility to specify command line options in a text file by using the Flags type (described below). Options are declared in a structure that contains all information needed for the options. Each exported field of the structure represents an option. The fields tag is used to provide additional details. The tag contains up to four pieces of information: The syntax of a tag is: The long and/or short options must come first in the tag. The parameter name is specified by appending =PARAM to one of the declared options (e.g., --option=VALUE). The description is everything following the option declaration(s). The options and description message are delimited by one or more white space characters. An empty option (- or --) terminates option declarations, everything following is the description. This enables the description to start with a -, e.g. "-v -- -v means verbose". The following are example tags A tag of just "-" causes the field to be ignored an not used as an option. An empty tag or missing tag causes the tag to be auto-generated. The fields of the structure can be any type that can be passed to getopt.Flag as a pointer (e.g., string, []string, int, bool, time.Duration, etc). This includes any type that implements getopt.Value. The following structure declares 7 options and sets the default value of Count to be 42. The --flags option is used to read option values from a file. The help message generated from theOptions is: The following are various ways to use the above declaration.

Registry - Source - Documentation - JSON
purl: pkg:golang/github.com/pborman/options
Keywords: getopt , go
License: Apache-2.0
Latest release: over 1 year ago
First release: about 6 years ago
Namespace: github.com/pborman
Dependent packages: 13
Dependent repositories: 5
Stars: 12 on GitHub
Forks: 0 on GitHub
Docker dependents: 1
Docker downloads: 15
See more repository details: repos.ecosyste.ms
Last synced: 20 days ago

    Loading...
    Readme
    Loading...