HORIZON HASKELLDocslts/ghc-9.10.x248f8f02026-10-05Search names, modules, packages, or :: a typeCtrl K

GHC 9.10.3 · lts/ghc-9.10.x · 248f8f0 · 2026-10-05

Modulererebase-1.21.2Haskell2010

System.Console.GetOpt

  • 3 types
  • 3 values
valuegetOpt
  1. :: ArgOrder a
  2. -> [OptDescr a]
  3. -> [String]
  4. -> ([a], [String], [String])
#

Process the command-line, and return the list of values that matched (and those that didn't). The arguments are:

  • The order requirements (see ArgOrder)

  • The option descriptions (see OptDescr)

  • The actual command line arguments (presumably got from getArgs).

getOpt returns a triple consisting of the option arguments, a list of non-options, and a list of error messages.

valuegetOpt'
  1. :: ArgOrder a
  2. -> [OptDescr a]
  3. -> [String]
  4. -> ([a], [String], [String], [String])
#

This is almost the same as getOpt, but returns a quadruple consisting of the option arguments, a list of non-options, a list of unrecognized options, and a list of error messages.

valueusageInfo :: String -> [OptDescr a] -> String
#

Return a string describing the usage of a command, derived from the header (first argument) and the options described by the second argument.