guyzmo / git-repo

Git-Repo: CLI utility to manage git services from your workspace
https://webchat.freenode.net/?channels=#git-repo
Other
842 stars 86 forks source link

git-repo cmd --help should show only options for that cmd #181

Closed jayvdb closed 7 years ago

jayvdb commented 7 years ago

This is likely a problem upstream in docopt, but it would be nice if the help showed only the relevant help.

Currently it shows the entire help.

$ git-repo clone --help
Usage:
    git-repo [--path=<path>] [-v...] <target> fork [--branch=<branch>]
    git-repo [--path=<path>] [-v...] <target> create [--add]
    git-repo [--path=<path>] [-v...] <target> delete [-f]
...
guyzmo commented 7 years ago

the issue is two fold. There's a way to reduce the size of the --help which is would be to have docopt support optional positional arguments using [] (which it does not cf #27). But the better approach as you're suggesting is planned for v2 in #28, which is to build git-repo with a command/subcommand approach to the help.

The reason why I chose the lengthy help approach was because it helped me craft the commands as I went easily making the necessary little changes to make it more convenient. But that's definitely less elegant and a rock in the shoe when it comes to document.

guyzmo commented 7 years ago

So I'm closing this issue so the discussion goes within #28.