Hedi-0.1: Line oriented editor

Helper

Description

Parse and pretty print the string of help of commands

Synopsis

Documentation

data CommandHelp Source

structure for the help of a command

Constructors

CommandHelp 

Fields

name :: String

the command name

synopsis :: String

how to run it

descriptions :: [String]

aspects

errors :: [String]

errors explanations

implementation :: String

implementation state

Instances

parseCommandsHelp :: CharParser () [CommandHelp]Source

parses all commands help

runSource

Arguments

:: String

The string to parse

-> GenParser Char () a

the parser to use

-> (a -> Maybe b)

a 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

Arguments

:: String

the 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

Arguments

:: String

the command name

-> String

the 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