HORIZON HASKELLDocslts/ghc-9.10.xc74966e2026-09-27Search names, modules, packages, or :: a typeCtrl K

GHC 9.10.3 · lts/ghc-9.10.x · c74966e · 2026-09-27

Modulerebase-1.21.2Haskell2010

Rebase.System.Console.GetOpt

  • 3 types
  • 3 values
  • Packagerebase-1.21.2
  • Exports6
  • LanguageHaskell2010
  • LicenceMIT
  • SourceGetOpt.hs
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.