<commit_before>
-- | This provides a compatiblity wrapper to the @System.Console.GetOpt@ module in @base@.
--   That module is essentially a Haskell port of the GNU @getopt@ library.
--
--   /Changes:/ The changes from @GetOpt@ are listed in the documentation for each function.
module System.Console.CmdArgs.GetOpt(
    convert, getOpt, getOpt', usageInfo,
    ArgOrder(..), OptDescr(..), ArgDescr(..)
    ) where

import System.Console.CmdArgs.Explicit


-- | What to do with options following non-options.
--
--   /Changes:/ Only 'Permute' is allowed, both @RequireOrder@ and @ReturnInOrder@
--   have been removed.
data ArgOrder a = Permute


-- | Each 'OptDescr' describes a single option/flag.
--
--   The arguments to 'Option' are:
--
--   * list of short option characters
--
--   * list of long option strings (without "--", may not be 1 character long)
--
--   * argument descriptor
--
--   * explanation of option for userdata
data OptDescr a = Option
    [Char]
    [String]
    (ArgDescr a)
    String


-- | Describes whether an option takes an argument or not, and if so
--   how the argument is injected into a value of type @a@.
data ArgDescr a
   = NoArg                   a         -- ^ no argument expected
   | ReqArg (String       -> a) String -- ^ option requires argument
   | OptArg (Maybe String -> a) String -- ^ optional argument


-- | Return a string describing the usage of a command, derived from<commit_msg>Fix a typo in the getopt documentation<commit_after>
-- | This provides a compatiblity wrapper to the @System.Console.GetOpt@ module in @base@.
--   That module is essentially a Haskell port of the GNU @getopt@ library.
--
--   /Changes:/ The changes from @GetOpt@ are listed in the documentation for each function.
module System.Console.CmdArgs.GetOpt(
    convert, getOpt, getOpt', usageInfo,
    ArgOrder(..), OptDescr(..), ArgDescr(..)
    ) where

import System.Console.CmdArgs.Explicit


-- | What to do with options following non-options.
--
--   /Changes:/ Only 'Permute' is allowed, both @RequireOrder@ and @ReturnInOrder@
--   have been removed.
data ArgOrder a = Permute


-- | Each 'OptDescr' describes a single option/flag.
--
--   The arguments to 'Option' are:
--
--   * list of short option characters
--
--   * list of long option strings (without @\"--\"@, may not be 1 character long)
--
--   * argument descriptor
--
--   * explanation of option for userdata
data OptDescr a = Option
    [Char]
    [String]
    (ArgDescr a)
    String


-- | Describes whether an option takes an argument or not, and if so
--   how the argument is injected into a value of type @a@.
data ArgDescr a
   = NoArg                   a         -- ^ no argument expected
   | ReqArg (String       -> a) String -- ^ option requires argument
   | OptArg (Maybe String -> a) String -- ^ optional argument


-- | Return a string describing the usage of a command, derived from
{'fraction_non_alphanumeric': 0.11069095909247163, 'fraction_numerical': 0.0006875214850464077, 'mean_word_length': 2.6329588014981273, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 7, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '1762046', 'n_tokens_mistral': 857, 'n_tokens_neox': 834, 'n_words': 349}