summaryrefslogtreecommitdiff
path: root/Types/Command.hs
diff options
context:
space:
mode:
authorGravatar Joey Hess <joey@kitenet.net>2012-01-05 22:48:59 -0400
committerGravatar Joey Hess <joey@kitenet.net>2012-01-05 23:11:07 -0400
commitad43f0362688a601ba43f462e80f5a91bf398c02 (patch)
tree550788062a775eb6b2c2c087052993aa10435875 /Types/Command.hs
parent47be4383b714320c9e3f49cc23315101fad5735b (diff)
per-command options
Finally commands can define their own options. Moved --format and --print0 to be options only of find.
Diffstat (limited to 'Types/Command.hs')
-rw-r--r--Types/Command.hs18
1 files changed, 10 insertions, 8 deletions
diff --git a/Types/Command.hs b/Types/Command.hs
index 3cabf7318..b173b61c9 100644
--- a/Types/Command.hs
+++ b/Types/Command.hs
@@ -8,6 +8,7 @@
module Types.Command where
import Types
+import Types.Option
{- A command runs in these stages.
-
@@ -32,14 +33,15 @@ type CommandPerform = Annex (Maybe CommandCleanup)
type CommandCleanup = Annex Bool
{- A command is defined by specifying these things. -}
-data Command = Command {
- cmdnorepo :: Maybe (IO ()), -- an action to run when not in a repo
- cmdcheck :: [CommandCheck], -- check stage
- cmdname :: String,
- cmdparamdesc :: String, -- description of params for usage
- cmdseek :: [CommandSeek], -- seek stage
- cmddesc :: String -- description of command for usage
-}
+data Command = Command
+ { cmdoptions :: [Option] -- command-specific options
+ , cmdnorepo :: Maybe (IO ()) -- an action to run when not in a repo
+ , cmdcheck :: [CommandCheck] -- check stage
+ , cmdname :: String
+ , cmdparamdesc :: String -- description of params for usage
+ , cmdseek :: [CommandSeek] -- seek stage
+ , cmddesc :: String -- description of command for usage
+ }
{- CommandCheck functions can be compared using their unique id. -}
instance Eq CommandCheck where