From 440f3b1068a1d0a49dff1307124c4f7f0bcd6f5d Mon Sep 17 00:00:00 2001 From: Joey Hess Date: Sat, 30 Nov 2013 15:18:40 -0400 Subject: 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. --- Types/Command.hs | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) (limited to 'Types/Command.hs') 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 -- cgit v1.2.3