Closed sofuture closed 9 years ago
package main
import (
"fmt"
"github.com/docopt/docopt-go"
)
func main() {
args, _ := docopt.Parse(helpText, nil, true, "foo", false)
fmt.Println(args["--bar"])
}
const helpText = `
Usage: foo [--bar=<value>]
Foo is a test program.
Options:
--bar value Test value [default: baz].
`
here's a fixed version of your example (need to remove after "Options:", and add value
(or w/e) between --bar and it's description.
@travisjeffery Thanks. Not sure if those things are specified clearly enough in the docs, but I'll close this out.
Doesn't look like defaults work. Example below, code: https://gist.github.com/jzellner/6b760f4663441b1abdb0