Hedi-0.1.1: Line oriented editorSource codeContentsIndex
Helper
Description
Parse and pretty print the string of help of commands
Synopsis
data CommandHelp = CommandHelp {
name :: String
synopsis :: String
descriptions :: [String]
errors :: [String]
implementation :: String
}
parseACommandHelp :: CharParser () CommandHelp
parseCommandsHelp :: CharParser () [CommandHelp]
run :: String -> GenParser Char () a -> (a -> Maybe b) -> Either String (Maybe b)
tabulate :: [[String]] -> String
listOfCommands :: String -> Either String (Maybe String)
helpCommand :: String -> String -> Either String (Maybe String)
Documentation
data CommandHelp Source
structure for the help of a command
Constructors
CommandHelp
name :: Stringthe command name
synopsis :: Stringhow to run it
descriptions :: [String]aspects
errors :: [String]errors explanations
implementation :: Stringimplementation state
show/hide Instances
parseACommandHelp :: CharParser () CommandHelpSource
parses a CommandHelp
parseCommandsHelp :: CharParser () [CommandHelp]Source
parses all commands help
runSource
::
=> StringThe string to parse
-> GenParser Char () athe parser to use
-> a -> Maybe ba function to use on the result , if it succed
-> Either String (Maybe b)the error showed if it fails or the result closed
run the parser against a string
tabulate :: [[String]] -> StringSource
create a nice table from lines of words
listOfCommandsSource
:: Stringthe string with the help inside
-> Either String (Maybe String)a parse error or Just a prettyprint of a list of command helps
parse a prettyprint of a list of command helps from a string
helpCommandSource
:: Stringthe command name
-> Stringthe string with the help inside
-> Either String (Maybe String)a parse error or (Just the command help or Nothing if the command is missing)
parse a prettyprint of a list of command helps from a string
Produced by Haddock version 2.3.0