options 1.1 → 1.2
raw patch · 3 files changed
+16/−6 lines, 3 files
Files
- lib/Options.hs +10/−1
- lib/Options/Help.hs +4/−3
- options.cabal +2/−2
lib/Options.hs view
@@ -103,6 +103,7 @@ -- ** Option groups , Group+ , group , groupName , groupTitle , groupDescription@@ -236,12 +237,20 @@ -- flag. The option will be parsed as if the given value were set. , optionTypeUnary :: Maybe val - -- If not Nothing, then options of this type may be set with repeated+ -- | If not Nothing, then options of this type may be set with repeated -- flags. Each flag will be parsed with 'optionTypeParse', and the -- resulting parsed values will be passed to this function for merger -- into the final value. , optionTypeMerge :: Maybe ([val] -> val) }++-- | Define an option group with the given name and title. Use+-- 'groupDescription' to add additional descriptive text, if needed.+group :: String -- ^ Name+ -> String -- ^ Title; see 'groupTitle'.+ -> String -- ^ Description; see 'groupDescription'.+ -> Group+group = Group -- | Define a new option type with the given name, default, and behavior. optionType :: String -- ^ Name
lib/Options/Help.hs view
@@ -181,9 +181,10 @@ let hasHelp = filter (\(g,_) -> groupName g == "all") groupInfos forM_ hasHelp showHelpGroup - tell "Application Options:\n"- forM_ ungroupedMainOptions showOptionHelp- unless (null subcmds) (tell "\n")+ unless (null ungroupedMainOptions) $ do+ tell "Application Options:\n"+ forM_ ungroupedMainOptions showOptionHelp+ unless (null subcmds) (tell "\n") case subcmdOptions of Nothing -> unless (null subcmds) $ do
options.cabal view
@@ -1,5 +1,5 @@ name: options-version: 1.1+version: 1.2 license: MIT license-file: license.txt author: John Millikin <john@john-millikin.com>@@ -78,7 +78,7 @@ source-repository this type: git location: https://john-millikin.com/code/haskell-options/- tag: haskell-options_1.1+ tag: haskell-options_1.2 library ghc-options: -Wall -O2