diff options
author | Joey Hess <joeyh@joeyh.name> | 2015-03-25 17:06:14 -0400 |
---|---|---|
committer | Joey Hess <joeyh@joeyh.name> | 2015-03-25 17:06:14 -0400 |
commit | 850241b7fed075c8a0055ae77cb30d6485aaa795 (patch) | |
tree | bbae2d577ea7daf136cfb80cdf87e4ce76681f84 /CmdLine | |
parent | 644cd4ca27e410ca567ec0f78acf2517d91d330e (diff) |
--auto is no longer a global option; only get, drop, and copy accept it.
Not a behavior change unless you were passing it to a command that ignored it.
Diffstat (limited to 'CmdLine')
-rw-r--r-- | CmdLine/GitAnnex/Options.hs | 3 | ||||
-rw-r--r-- | CmdLine/Option.hs | 3 | ||||
-rw-r--r-- | CmdLine/Seek.hs | 5 |
3 files changed, 5 insertions, 6 deletions
diff --git a/CmdLine/GitAnnex/Options.hs b/CmdLine/GitAnnex/Options.hs index add29d8da..be1c74ede 100644 --- a/CmdLine/GitAnnex/Options.hs +++ b/CmdLine/GitAnnex/Options.hs @@ -142,3 +142,6 @@ timeLimitOption :: Option timeLimitOption = Option ['T'] ["time-limit"] (ReqArg Limit.addTimeLimit paramTime) "stop after the specified amount of time" + +autoOption :: Option +autoOption = flagOption ['a'] "auto" "automatic mode" diff --git a/CmdLine/Option.hs b/CmdLine/Option.hs index 2d4e67fa3..0cda34ba1 100644 --- a/CmdLine/Option.hs +++ b/CmdLine/Option.hs @@ -30,8 +30,6 @@ commonOptions = "allow actions that may lose annexed data" , Option ['F'] ["fast"] (NoArg (setfast True)) "avoid slow operations" - , Option ['a'] ["auto"] (NoArg (setauto True)) - "automatic mode" , Option ['q'] ["quiet"] (NoArg (Annex.setOutput QuietOutput)) "avoid verbose output" , Option ['v'] ["verbose"] (NoArg (Annex.setOutput NormalOutput)) @@ -50,7 +48,6 @@ commonOptions = where setforce v = Annex.changeState $ \s -> s { Annex.force = v } setfast v = Annex.changeState $ \s -> s { Annex.fast = v } - setauto v = Annex.changeState $ \s -> s { Annex.auto = v } setforcebackend v = Annex.changeState $ \s -> s { Annex.forcebackend = Just v } setdebug = Annex.changeGitConfig $ \c -> c { annexDebug = True } unsetdebug = Annex.changeGitConfig $ \c -> c { annexDebug = False } diff --git a/CmdLine/Seek.hs b/CmdLine/Seek.hs index 7bfea45d0..b5726f53e 100644 --- a/CmdLine/Seek.hs +++ b/CmdLine/Seek.hs @@ -173,13 +173,12 @@ withNothing _ _ = error "This command takes no parameters." - - Otherwise, fall back to a regular CommandSeek action on - whatever params were passed. -} -withKeyOptions :: (Key -> CommandStart) -> CommandSeek -> CommandSeek -withKeyOptions keyop fallbackop params = do +withKeyOptions :: Bool -> (Key -> CommandStart) -> CommandSeek -> CommandSeek +withKeyOptions auto keyop fallbackop params = do bare <- fromRepo Git.repoIsLocalBare allkeys <- Annex.getFlag "all" unused <- Annex.getFlag "unused" specifickey <- Annex.getField "key" - auto <- Annex.getState Annex.auto when (auto && bare) $ error "Cannot use --auto in a bare repository" case (allkeys, unused, null params, specifickey) of |