-
Notifications
You must be signed in to change notification settings - Fork 108
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Strange error when parsing usage: unmatched '(', expected: ')' got: '' #26
Comments
I've got almost the same error.
And I don't know how to balance it. usage := `go-gist
go-gist lets you upload to https://gist.github.com/. Go clone of the official Gist client.
Usage:
go-gist [-oce] [-p] [-s] [-R] [-d DESC] [-a] [-u URL] [-P] (-f NAME | -t EXT) FILE...
go-gist --login
Options:
--login Authenticate gist on this computer.
-f NAME --filename=NAME Sets the filename and syntax type.
-t EXT --type=EXT Sets the file extension and syntax type.
-p --private Indicates whether the gist is private.
-d DESC --description=DESC Adds a description to your gist.
-s --shorten *Shorten the gist URL using git.io.
-u URL --update=URL Update an existing gist.
-a --anonymous Create an anonymous gist.
-c --copy Copy the resulting URL to the clipboard.
-e --embed *Copy the embed code for the gist to the clipboard.
-o --open *Open the resulting URL in a browser.
-P --paste Paste from the clipboard to gist.
-R --raw *Display raw URL of the new gist.
-l USER --list=USER Lists all gists for a user.
-h --help Show this help message and exit.
--version Show version and exit.`
arguments, err := docopt.Parse(usage, nil, true, "go-gist "+VERSION, false)
fmt.Println(arguments)
if err != nil {
fmt.Fprintf(os.Stderr, "Error: %v\n", err)
os.Exit(1)
} go version go1.3.3 darwin/amd64 |
Use two spaces to separate options with their informal description. eg. 4 spaces, "--login", 2 SPACES, followed by optional tabs for formatting, "Authenticate gist on this computer."
|
Indeed, Options are not being parsed correctly at all, using the example on the README:
Which renders the package unusable |
@catinello had the exact same issue :
Debugging this was a pain, adding 2 spaces before the tab formatting resolved it ! Seems like the |
I ran into this issue too, just DON'T use |
Awesome ! |
Print statements would indicate that somewhere along the way a parseSeq call attempts to call parseAtom and it fails because the ([ and )] characters are unbalanced in the tokenList. There is an extra ).
If I add a ) char after --showcolors the error goes away.
The text was updated successfully, but these errors were encountered: