set oneshot mode on a per-command basis

Avoids ugly (and test suite failing) hack in Command.Version
This commit is contained in:
Joey Hess 2012-02-14 12:40:40 -04:00
parent 33e03d58ae
commit 90a8b38ac0
11 changed files with 19 additions and 16 deletions

View file

@ -8,6 +8,7 @@
module Command (
command,
noRepo,
oneShot,
withOptions,
next,
stop,
@ -39,7 +40,11 @@ import Annex.CheckAttr
{- Generates a normal command -}
command :: String -> String -> [CommandSeek] -> String -> Command
command = Command [] Nothing commonChecks
command = Command [] Nothing commonChecks False
{- Makes a command run in oneshot mode. -}
oneShot :: Command -> Command
oneShot c = c { cmdoneshot = True }
{- Adds a fallback action to a command, that will be run if it's used
- outside a git repository. -}