summaryrefslogtreecommitdiff
path: root/CmdLine
diff options
context:
space:
mode:
Diffstat (limited to 'CmdLine')
-rw-r--r--CmdLine/GitAnnex/Options.hs7
-rw-r--r--CmdLine/GitAnnexShell.hs13
-rw-r--r--CmdLine/Option.hs4
3 files changed, 11 insertions, 13 deletions
diff --git a/CmdLine/GitAnnex/Options.hs b/CmdLine/GitAnnex/Options.hs
index 8bc96a14d..bb002a103 100644
--- a/CmdLine/GitAnnex/Options.hs
+++ b/CmdLine/GitAnnex/Options.hs
@@ -29,10 +29,9 @@ import CmdLine.Usage
-- Global options that are accepted by all git-annex sub-commands,
-- although not always used.
-gitAnnexGlobalOptions :: Parser GlobalSetter
-gitAnnexGlobalOptions = globalSetters
- [ commonGlobalOptions
- , globalSetter setnumcopies $ option auto
+gitAnnexGlobalOptions :: [Parser GlobalSetter]
+gitAnnexGlobalOptions = commonGlobalOptions ++
+ [ globalSetter setnumcopies $ option auto
( long "numcopies" <> short 'N' <> metavar paramNumber
<> help "override default number of copies"
)
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
diff --git a/CmdLine/Option.hs b/CmdLine/Option.hs
index 9cb1d41d4..d28c7a704 100644
--- a/CmdLine/Option.hs
+++ b/CmdLine/Option.hs
@@ -25,8 +25,8 @@ import Types.Messages
import Types.DeferredParse
-- Global options accepted by both git-annex and git-annex-shell sub-commands.
-commonGlobalOptions :: Parser GlobalSetter
-commonGlobalOptions = globalSetters
+commonGlobalOptions :: [Parser GlobalSetter]
+commonGlobalOptions =
[ globalFlag (setforce True)
( long "force"
<> help "allow actions that may lose annexed data"