docopt.go icon indicating copy to clipboard operation
docopt.go copied to clipboard

Unknown command locally, but works in try docopt

Open mastoj opened this issue 8 years ago • 1 comments

I have the following docopt spec:

poisson

	Usage:
		poisson
		poisson start --project=<project> [--norestore]
		poisson populatebq --project=<project>
		poisson populatemongo --project=<project>

	Options:
		-h --help			Show this screen.
		--version			Show version.
		--project=<project>	Project id.
		--norestore			If specified restore of db will not take place.

Note that this is the first time using docopt, so I could probably do something differently. With that said. When I try to run the app that has this specification with the following line:

go run main.go start --norestore --project=projectname

It fails with unknown command. If I remove the last line --norestore... from the spec if works fine. The first one also works on try docopt: http://try.docopt.org/?doc=poisson%0D%0A%0D%0A%09Usage%3A%0D%0A%09%09poisson%0D%0A%09%09poisson+start+--project%3D%3Cproject%3E+%5B--norestore%5D%0D%0A%09%09poisson+populatebq+--project%3D%3Cproject%3E%0D%0A%09%09poisson+populatemongo+--project%3D%3Cproject%3E%0D%0A%0D%0A%09Options%3A%0D%0A%09%09-h+--help%09%09%09Show+this+screen.%0D%0A%09%09--version%09%09%09Show+version.%0D%0A%09%09--project%3D%3Cproject%3E%09Project+id.%0D%0A%09%09--norestore%09%09%09If+specified+restore+of+db+will+not+take+place.&argv=start+--project%3Dasd+--norestore

mastoj avatar Oct 26 '17 11:10 mastoj

Can you post reproducible code?

ghostsquad avatar Nov 13 '17 19:11 ghostsquad