flynn/flynn-cli — pull request #18 by archSeer (2014-06-13 20:20:14+00:00)
Title: Docopt port

Work in progress, not to merge yet. Will resolve #12. Based on my other PR.

@titanous would you care to review this? There's a couple of changes, the controller client is instantiated for each command, as it doesn't use the Command struct anymore. I've also commented out the updater inside of `main` for now, and I think [this](https://github.com/archSeer/flynn-cli/blob/3454936876212ed131d6196b0590ced25388e152/main.go#L204-L217) could be done with a hashmap -- although if we decide on using very little top-level commands, it might work just fine.

A couple of things to note: "flynn help " is pre-processed to "flynn --help", which is why I am passing trough the modified argv (`docopt.Parse(usage, argv, true, "", false)`) instead of using the script one (`docopt.Parse(usage, nil, true, "", false)`). Command parsing is done "recursively", first it checks the general validity inside `main` and then it checks it again for the specified command inside the specific `run` command (which is why every method calls `docopt.Parse`).