per-command options
Finally commands can define their own options. Moved --format and --print0 to be options only of find.
This commit is contained in:
parent
47be4383b7
commit
ad43f03626
9 changed files with 162 additions and 87 deletions
|
@ -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
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue