Top 0.2% dependent packages on proxy.golang.org
Top 0.1% dependent repos on proxy.golang.org
Top 2.5% forks on proxy.golang.org
Top 0.2% docker downloads on proxy.golang.org
proxy.golang.org : github.com/docopt/docopt-go
Package docopt parses command-line arguments based on a help message. Given a conventional command-line help message, docopt processes the arguments. See https://github.com/docopt/docopt#help-message-format for a description of the help message format. This package exposes three different APIs, depending on the level of control required. The first, simplest way to parse your docopt usage is to just call: This will use os.Args[1:] as the argv slice, and use the default parser options. If you want to provide your own version string and args, then use: If the last parameter (version) is a non-empty string, it will be printed when --version is given in the argv slice. Finally, we can instantiate our own docopt.Parser which gives us control over how things like help messages are printed and whether to exit after displaying usage messages, etc. In particular, setting your own custom HelpHandler function makes unit testing your own docs with example command line invocations much more enjoyable. All three of these return a map of option names to the values parsed from argv, and an error or nil. You can get the values using the helpers, or just treat it as a regular map: Additionally, you can `Bind` these to a struct, assigning option values to the exported fields of that struct, all at once.
Registry
-
Source
- Documentation
- JSON
purl: pkg:golang/github.com/docopt/docopt-go
License: MIT
Latest release: over 7 years ago
First release: over 10 years ago
Namespace: github.com/docopt
Dependent packages: 650
Dependent repositories: 39,765
Stars: 1,390 on GitHub
Forks: 111 on GitHub
Docker dependents: 223
Docker downloads: 289,123,328
See more repository details: repos.ecosyste.ms
Last synced: 3 days ago