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
When a non-option line comes after the Options: declaration, parsing fails in weird ways. Not only are options missing, but -h and --help are now split. This doesn't happen at try.docopt.org.
Repro
Start with the options shortcut example
package main
import (
"fmt""github.com/docopt/docopt-go"
)
funcmain() {
usage:=`Example of program which uses [options] shortcut in pattern.Usage: options_shortcut_example [options] <port> options_shortcut_example -h | --helpOptions: -h --help show this help message and exit --version show version and exit -n, --number N use N as a number -t, --timeout TIMEOUT set timeout TIMEOUT seconds --apply apply changes to database -q operate in quiet mode`arguments, _:=docopt.Parse(usage, nil, false, "1.0.0rc2", false)
fmt.Println(arguments)
}
Modify as such
Options:
+These are things
-h --help show this help message and exit
Expected Behavior
$ go run options_shortcut_example.go --help
map[<port>:<nil> --help:true --version:false --number:<nil> --timeout:<nil> --apply:false -q:false]
Actual Behavior
$ go run options_shortcut_example.go --help
map[<port>:<nil> -h:false --help:true]
The text was updated successfully, but these errors were encountered:
Description
When a non-option line comes after the
Options:
declaration, parsing fails in weird ways. Not only are options missing, but-h
and--help
are now split. This doesn't happen at try.docopt.org.Repro
Options: +These are things -h --help show this help message and exit
Expected Behavior
Actual Behavior
The text was updated successfully, but these errors were encountered: