-- Hoogle documentation, generated by Haddock -- See Hoogle, http://www.haskell.org/hoogle/ -- | Utility functions for working with optparse-applicative -- -- See README.md here @package optparse-applicative-cmdline-util @version 0.2.0 -- | This module contains utility functions for working with the -- 'optparse-applicative' library. -- -- Much of the module revolves around easily building options that can -- take "multiple arguments" in the form of separated inputs (e.g. -- program --option one,two,three,four). This still honours the POSIX -- standard for options only taking a single argument (by not using -- spaces to separate the different inputs), while also being very -- convenient to enter (as opposed to, say, wrapping everything inside -- quotes). -- -- Another focus involves connecting the attoparsec library with -- 'optparse-applicative' (this is often useful when options involve more -- complex parsing patterns). module Options.Applicative.CmdLine.Util -- | Less confusion as to which Parser one is referring to. type AttoParser = Parser -- | Attoparsec -- optparse-applicative interface. attoReadM :: AttoParser a -> ReadM a -- | Like option, but takes an AttoParser instead of a -- ReadM. optionA :: AttoParser a -> Mod OptionFields a -> Parser a -- | Parse a collection of things, separated by some specific characters. splitWith :: AttoParser p -> String -> AttoParser [p] -- | Like splitWith, but the parser is just taking everything it can -- until the next separation character. splitOn :: String -> AttoParser [Text] -- | Create a parser that matches any of the given a, with the -- given aliases. anyOf :: [(a, [Text])] -> AttoParser a -- | Like anyOf but, after having found a match, skip all remaining -- text as long as the given predicate is true. anyOfSkip :: (Char -> Bool) -> [(a, [Text])] -> AttoParser a -- | Like anyOf, but return a 'ReadM a' instead of an 'AttoParser -- a'. anyOfRM :: [(a, [Text])] -> ReadM a -- | Create a parser that matches case-insensitively for all elements of a -- given list. aliases :: Foldable t => t Text -> AttoParser Text -- | Pretty print some container of separation characters, inserting a -- space between each item. showSepChars :: Foldable t => t Char -> String