hsoptions-1.0.0.0: Haskell library that supports command-line flag processing

Portabilityportable
Stabilitystable
MaintainerJose Raymundo Cruz (jose.r.cruz01@gmail.com)
Safe HaskellSafe-Inferred

System.Console.HsOptions.Parser

Contents

Description

Provides the parser features that takes a input stream of characters and returns a stream of tokens.

These tokens are easier to handle as the syntax of the flags was enforced by the parser.

Synopsis

Parser functions

parseInput :: DefaultOp -> String -> [Token]Source

Parses the flags from the input stream of characters to a stream of tokens.

Based on the syntax of the flags input this parser should not fail. If there is any kind of errors while parsing an exception is thrown.

Arguments:

  • default_operations: a map from flag name to default operation.
  • input: the input stream of characters.

Returns:

  • A stream of tokens.

Throws:

  • An exception if some error with the parser occurs.