aboutsummaryrefslogtreecommitdiff
path: root/Types/Command.hs
diff options
context:
space:
mode:
authorGravatar Joey Hess <joey@kitenet.net>2013-11-30 15:18:40 -0400
committerGravatar Joey Hess <joey@kitenet.net>2013-11-30 15:18:40 -0400
commit440f3b1068a1d0a49dff1307124c4f7f0bcd6f5d (patch)
treedcc4b0c54f52b89aa95956c0e32cf6e781f17057 /Types/Command.hs
parentf04b34c4584e18f4c722700eda5e80eb0345f035 (diff)
make "git annex help options" work outside a git repo
Option parsing for commands that run outside git repos is still screwy, as there is no Annex monad and so the flags cannot be passed in. But, any remaining parameters can be, which is enough for this fix.
Diffstat (limited to 'Types/Command.hs')
-rw-r--r--Types/Command.hs4
1 files changed, 3 insertions, 1 deletions
diff --git a/Types/Command.hs b/Types/Command.hs
index 3187efd17..d012c6e25 100644
--- a/Types/Command.hs
+++ b/Types/Command.hs
@@ -36,7 +36,7 @@ type CommandCleanup = Annex Bool
{- A command is defined by specifying these things. -}
data Command = Command
{ cmdoptions :: [Option] -- command-specific options
- , cmdnorepo :: Maybe (IO ()) -- an action to run when not in a repo
+ , cmdnorepo :: Maybe (CmdParams -> IO ()) -- an action to run when not in a repo
, cmdcheck :: [CommandCheck] -- check stage
, cmdnocommit :: Bool -- don't commit journalled state changes
, cmdnomessages :: Bool -- don't output normal messages
@@ -47,6 +47,8 @@ data Command = Command
, cmddesc :: String -- description of command for usage
}
+type CmdParams = [String]
+
{- CommandCheck functions can be compared using their unique id. -}
instance Eq CommandCheck where
a == b = idCheck a == idCheck b