set oneshot mode on a per-command basis
Avoids ugly (and test suite failing) hack in Command.Version
This commit is contained in:
parent
33e03d58ae
commit
90a8b38ac0
11 changed files with 19 additions and 16 deletions
|
@ -28,8 +28,8 @@ type Params = [String]
|
|||
type Flags = [Annex ()]
|
||||
|
||||
{- Runs the passed command line. -}
|
||||
dispatch :: Bool -> Params -> [Command] -> [Option] -> String -> IO Git.Repo -> IO ()
|
||||
dispatch oneshot args cmds commonoptions header getgitrepo = do
|
||||
dispatch :: Params -> [Command] -> [Option] -> String -> IO Git.Repo -> IO ()
|
||||
dispatch args cmds commonoptions header getgitrepo = do
|
||||
setupConsole
|
||||
r <- E.try getgitrepo :: IO (Either E.SomeException Git.Repo)
|
||||
case r of
|
||||
|
@ -39,7 +39,7 @@ dispatch oneshot args cmds commonoptions header getgitrepo = do
|
|||
(actions, state') <- Annex.run state $ do
|
||||
sequence_ flags
|
||||
prepCommand cmd params
|
||||
tryRun state' cmd $ [startup] ++ actions ++ [shutdown oneshot]
|
||||
tryRun state' cmd $ [startup] ++ actions ++ [shutdown $ cmdoneshot cmd]
|
||||
where
|
||||
(flags, cmd, params) = parseCmd args cmds commonoptions header
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue