diff options
author | Joey Hess <joeyh@joeyh.name> | 2015-07-10 02:03:03 -0400 |
---|---|---|
committer | Joey Hess <joeyh@joeyh.name> | 2015-07-10 02:03:03 -0400 |
commit | ccd76ebf641ad481e549da97c85f73101a3149fd (patch) | |
tree | 254f0d644e4998ff73046de74fa4fa4f91735ec8 /CmdLine/GitAnnexShell.hs | |
parent | 56c0bf6c690ffddc4ac561393f4cd21d087b7ddb (diff) |
wired up global options
Note that I ran into a problem where parsing the global options looped
forever, eating memory. It was somehow caused by stacking
combineGlobalSetters inside a combineGlobalSetters. Maybe due to both
using "many"? Anyway, changed things to avoid that.
Diffstat (limited to 'CmdLine/GitAnnexShell.hs')
-rw-r--r-- | CmdLine/GitAnnexShell.hs | 13 |
1 files changed, 6 insertions, 7 deletions
diff --git a/CmdLine/GitAnnexShell.hs b/CmdLine/GitAnnexShell.hs index 5bc297a71..c653e8626 100644 --- a/CmdLine/GitAnnexShell.hs +++ b/CmdLine/GitAnnexShell.hs @@ -53,14 +53,13 @@ cmds = map adddirparam $ cmds_readonly ++ cmds_notreadonly where adddirparam c = c { cmdparamdesc = "DIRECTORY " ++ cmdparamdesc c } -options :: Parser GlobalSetter -options = globalSetters - [ commonGlobalOptions - , globalSetter checkUUID $ strOption +globalOptions :: [Parser GlobalSetter] +globalOptions = + globalSetter checkUUID (strOption ( long "uuid" <> metavar paramUUID <> help "local repository uuid" - ) - ] + )) + : commonGlobalOptions where checkUUID expected = getUUID >>= check where @@ -101,7 +100,7 @@ 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 mkrepo + dispatch False (cmd : params') cmds globalOptions fields mkrepo "git-annex-shell" "Restricted login shell for git-annex only SSH access" where |