| hoogle | Source code | Contents | Index

CmdLine.Query

Description

Parse a query, that may have come from either a CGI variable or the command line arguments.

Need to return the following pieces of information:

- Was there a query, or was nothing entered
- Are you wanting to operate in Web mode or Command Line mode. Adding a Web parameter to Command Line gives you Web mode.
- Which flags were specified, and which were erroneous.

Synopsis

cmdQuery :: IO CmdQuery

data CmdQuery = CmdQuery {

queryWeb :: Bool
queryText :: String
query :: Either ParseError Query
queryFlags :: [CmdFlag]
queryBadFlags :: [String]

}

Documentation

cmdQuery :: IO CmdQuery | Source

Left (query text, error message), null query text = no query given Right (query, command line flags, unparsable/unsupported flags)

data CmdQuery | Source

Constructors

CmdQuery |

queryWeb :: Bool | Are you operating from the web (via CGI)
queryText :: String | The string the user entered, `""` for no string
query :: Either ParseError Query | The actual query
queryFlags :: [CmdFlag] | The flags from the query
queryBadFlags :: [String] | The bad flags

Instances

Show CmdQuery

Produced by Haddock version 2.4.2