hoogleSource codeContentsIndex
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 CmdQuerySource
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 :: BoolAre you operating from the web (via CGI)
queryText :: StringThe string the user entered, "" for no string
query :: Either ParseError QueryThe actual query
queryFlags :: [CmdFlag]The flags from the query
queryBadFlags :: [String]The bad flags
show/hide Instances
Produced by Haddock version 2.4.2