darcs-2.18.5: a distributed, interactive, smart revision control system

Safe Haskell | None
Language | Haskell2010

Darcs.UI.Commands

Synopsis

- data CommandControl
  - = CommandData DarcsCommand
  - | HiddenCommand DarcsCommand
  - | GroupName String
- data DarcsCommand
  - = DarcsCommand {
    - commandProgramName :: String
    - commandName :: String
    - commandHelp :: Doc
    - commandDescription :: String
    - commandExtraArgs :: Int
    - commandExtraArgHelp :: [String]
    - commandCommand :: (AbsolutePath, AbsolutePath) -> [DarcsFlag] -> [String] -> IO ()
    - commandPrereq :: [DarcsFlag] -> IO (Either String ())
    - commandCompleteArgs :: (AbsolutePath, AbsolutePath) -> [DarcsFlag] -> [String] -> IO [String]
    - commandArgdefaults :: [DarcsFlag] -> AbsolutePath -> [String] -> IO [String]
    - commandOptions :: CommandOptions
    }
  - | SuperCommand {
    - commandProgramName :: String
    - commandName :: String
    - commandHelp :: Doc
    - commandDescription :: String
    - commandPrereq :: [DarcsFlag] -> IO (Either String ())
    - commandSubCommands :: [CommandControl]
    }
- commandAlias :: String -> Maybe DarcsCommand -> DarcsCommand -> DarcsCommand
- commandStub :: String -> Doc -> String -> DarcsCommand -> DarcsCommand
- withStdOpts :: DarcsOption (Maybe StdCmdAction -> Verbosity -> b) c -> DarcsOption (UseCache -> UseIndex -> HooksConfig -> Bool -> Bool -> [DarcsFlag]) b -> CommandOptions
- commandOptDescr :: AbsolutePath -> DarcsCommand -> [OptDescr DarcsFlag]
- commandAlloptions :: DarcsCommand -> ([DarcsOptDescr DarcsFlag], [DarcsOptDescr DarcsFlag])
- commandDefaults :: DarcsCommand -> [DarcsFlag]
- commandCheckOptions :: DarcsCommand -> [DarcsFlag] -> [OptMsg]
- disambiguateCommands :: [CommandControl] -> String -> [String] -> Either String (CommandArgs, [String])
- data CommandArgs
  - = CommandOnly DarcsCommand
  - | SuperCommandOnly DarcsCommand
  - | SuperCommandSub DarcsCommand DarcsCommand
- getSubcommands :: DarcsCommand -> [CommandControl]
- extractCommands :: [CommandControl] -> [DarcsCommand]
- extractAllCommands :: [CommandControl] -> [DarcsCommand]
- normalCommand :: DarcsCommand -> CommandControl
- hiddenCommand :: DarcsCommand -> CommandControl
- commandGroup :: String -> CommandControl
- superName :: Maybe DarcsCommand -> String
- nodefaults :: [DarcsFlag] -> AbsolutePath -> [String] -> IO [String]
- putInfo :: [DarcsFlag] -> Doc -> IO ()
- putVerbose :: [DarcsFlag] -> Doc -> IO ()
- putWarning :: [DarcsFlag] -> Doc -> IO ()
- putVerboseWarning :: [DarcsFlag] -> Doc -> IO ()
- putFinished :: [DarcsFlag] -> String -> IO ()
- abortRun :: [DarcsFlag] -> Doc -> IO ()
- setEnvDarcsPatches :: forall (p :: Type -> Type -> Type) wX wY. RepoPatch p => FL (PatchInfoAnd p) wX wY -> IO ()
- setEnvDarcsFiles :: PatchInspect p => p wX wY -> IO ()
- defaultRepo :: [DarcsFlag] -> AbsolutePath -> [String] -> IO [String]
- amInHashedRepository :: [DarcsFlag] -> IO (Either String ())
- amInRepository :: [DarcsFlag] -> IO (Either String ())
- amNotInRepository :: [DarcsFlag] -> IO (Either String ())
- findRepository :: [DarcsFlag] -> IO (Either String ())

# Documentation

data CommandControl #

Constructors

CommandData DarcsCommand |
HiddenCommand DarcsCommand |
GroupName String |

data DarcsCommand #

A `DarcsCommand` represents a command like add, record etc.

Constructors

DarcsCommand |
Fields commandProgramName :: String commandName :: String commandHelp :: Doc commandDescription :: String commandExtraArgs :: Int commandExtraArgHelp :: [String] commandCommand :: (AbsolutePath, AbsolutePath) -> [DarcsFlag] -> [String] -> IO () commandPrereq :: [DarcsFlag] -> IO (Either String ()) commandCompleteArgs :: (AbsolutePath, AbsolutePath) -> [DarcsFlag] -> [String] -> IO [String] commandArgdefaults :: [DarcsFlag] -> AbsolutePath -> [String] -> IO [String] commandOptions :: CommandOptions
SuperCommand |
Fields commandProgramName :: String commandName :: String commandHelp :: Doc commandDescription :: String commandPrereq :: [DarcsFlag] -> IO (Either String ()) commandSubCommands :: [CommandControl]

commandAlias :: String -> Maybe DarcsCommand -> DarcsCommand -> DarcsCommand #

commandStub :: String -> Doc -> String -> DarcsCommand -> DarcsCommand #

withStdOpts :: DarcsOption (Maybe StdCmdAction -> Verbosity -> b) c -> DarcsOption (UseCache -> UseIndex -> HooksConfig -> Bool -> Bool -> [DarcsFlag]) b -> CommandOptions #

Construct `CommandOptions` from the command specific basic and advanced `DarcsOption`s

commandOptDescr :: AbsolutePath -> DarcsCommand -> [OptDescr DarcsFlag] #

Option descriptions as required by `getOpt`, i.e. resolved with the given `AbsolutePath`.

commandAlloptions :: DarcsCommand -> ([DarcsOptDescr DarcsFlag], [DarcsOptDescr DarcsFlag]) #

Option descriptions split into basic and advanced options

commandDefaults :: DarcsCommand -> [DarcsFlag] #

Built-in default values for all `DarcsFlag`s supported by the given command

commandCheckOptions :: DarcsCommand -> [DarcsFlag] -> [OptMsg] #

For the given `DarcsCommand` check the given `DarcsFlag`s for consistency

disambiguateCommands :: [CommandControl] -> String -> [String] -> Either String (CommandArgs, [String]) #

data CommandArgs #

Constructors

CommandOnly DarcsCommand |
SuperCommandOnly DarcsCommand |
SuperCommandSub DarcsCommand DarcsCommand |

getSubcommands :: DarcsCommand -> [CommandControl] #

extractCommands :: [CommandControl] -> [DarcsCommand] #

extractAllCommands :: [CommandControl] -> [DarcsCommand] #

normalCommand :: DarcsCommand -> CommandControl #

hiddenCommand :: DarcsCommand -> CommandControl #

commandGroup :: String -> CommandControl #

superName :: Maybe DarcsCommand -> String #

nodefaults :: [DarcsFlag] -> AbsolutePath -> [String] -> IO [String] #

putInfo :: [DarcsFlag] -> Doc -> IO () #

putVerbose :: [DarcsFlag] -> Doc -> IO () #

putWarning :: [DarcsFlag] -> Doc -> IO () #

putVerboseWarning :: [DarcsFlag] -> Doc -> IO () #

putFinished :: [DarcsFlag] -> String -> IO () #

abortRun :: [DarcsFlag] -> Doc -> IO () #

setEnvDarcsPatches :: forall (p :: Type -> Type -> Type) wX wY. RepoPatch p => FL (PatchInfoAnd p) wX wY -> IO () #

Set the DARCS_PATCHES and DARCS_PATCHES_XML environment variables with info about the given patches, for use in post-hooks.

setEnvDarcsFiles :: PatchInspect p => p wX wY -> IO () #

Set the DARCS_FILES environment variable to the files touched by the given patch, one per line, for use in post-hooks.

defaultRepo :: [DarcsFlag] -> AbsolutePath -> [String] -> IO [String] #

To use for commandArgdefaults field.

amInHashedRepository :: [DarcsFlag] -> IO (Either String ()) #

amInRepository :: [DarcsFlag] -> IO (Either String ()) #

amNotInRepository :: [DarcsFlag] -> IO (Either String ()) #

findRepository :: [DarcsFlag] -> IO (Either String ()) #