let optparse-applicative handle the usage display when run w/o command or bad command

Still generating the list of commands myself, to get it sorted into
sections and with short synopses.
This commit is contained in:
Joey Hess 2015-07-09 11:49:52 -04:00
parent 6204dcbd7b
commit 8a9d2a6e9d
5 changed files with 42 additions and 30 deletions

View file

@ -101,7 +101,9 @@ builtin cmd dir params = do
let (params', fieldparams, opts) = partitionParams params
rsyncopts = ("RsyncOptions", unwords opts)
fields = rsyncopts : filter checkField (parseFields fieldparams)
dispatch False (cmd : params') cmds options fields header mkrepo
dispatch False (cmd : params') cmds options fields mkrepo
"git-annex-shell"
"Restricted login shell for git-annex only SSH access"
where
mkrepo = do
r <- Git.Construct.repoAbsPath dir >>= Git.Construct.fromAbsPath