You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Golang implementation of [docopt](http://docopt.org/) 0.6.1+fix
6
+
An implementation of [docopt](http://docopt.org/) in the
7
+
[Go](http://golang.org/) programming language.
7
8
8
-
## Installation
9
-
10
-
import "github.com/docopt/docopt-go" and then run `go get`.
11
-
12
-
## API
13
-
14
-
```go
15
-
func docopt.Parse(doc string, argv []string, help bool, version string, optionsFirst bool)
16
-
(args map[string]interface{}, err error)
17
-
```
18
-
19
-
Parse `argv` based on command-line interface described in `doc`.
20
-
21
-
docopt creates your command-line interface based on its description that you pass as `doc`. Such description can contain --options, <positional-argument>, commands, which could be [optional], (required), (mutually | exclusive) or repeated...
22
-
23
-
### arguments
24
-
25
-
`doc` Description of your command-line interface.
26
-
27
-
`argv` Argument vector to be parsed. os.Args[1:] is used if nil.
28
-
29
-
`help` Set to false to disable automatic help on -h or --help options..
30
-
31
-
`version` If set to something besides an empty string, the string will be printed
32
-
if --version is in argv.
33
-
34
-
`optionsFirst` Set to true to require options precede positional arguments,
35
-
i.e. to forbid options and positional arguments intermix..
36
-
37
-
### return values
38
-
39
-
`args`, map[string]interface{}. A map, where keys are names of command-line elements such as e.g. "--verbose" and "<path>", and values are the parsed values of those elements. interface{} can be `bool`, `int`, `string`, `[]string`.
40
-
41
-
`err`, error. Either *docopt.LanguageError, *docopt.UserError or nil
9
+
**docopt** helps you create *beautiful* command-line interfaces easily:
0 commit comments