packages feed

cmdlib 0.3 → 0.3.1

raw patch · 3 files changed

+19/−1 lines, 3 filesPVP ok

version bump matches the API change (PVP)

API changes (from Hackage documentation)

+ System.Console.CmdLib: rec_optionStyle :: RecordCommand cmd => cmd -> OptionStyle
+ System.Console.CmdLib: rec_superCommand :: RecordCommand cmd => cmd -> Bool

Files

System/Console/CmdLib.hs view
@@ -44,6 +44,10 @@ module System.Console.CmdLib (   -- * News   --+  -- | Since version 0.3.1: "rec_optionStyle" and "rec_superCommand" have been+  -- added to the "RecordCommand" class, granting more flexibility to+  -- the record-based command interface.+  --   -- | Since version 0.3: "dispatchR" no longer takes a cmd argument, as it was   -- never used for anything and was simply confusing. A new function,   -- "dispatchOr" has been added to allow the program to continue despite
System/Console/CmdLib/Record.hs view
@@ -113,6 +113,16 @@   rec_options :: cmd -> AttributeMap Key   rec_options _ = EmptyMap +  -- | Set the per-command option style, useful for supercommands to pass their+  -- options through to another dispatch, by using NoOptions.+  rec_optionStyle :: cmd -> OptionStyle+  rec_optionStyle _ = Permuted++  -- | Pattern match like in @run'@ to identify any supercommands, which will+  -- allow --help flags to be passed through to the sub-commands.+  rec_superCommand :: cmd -> Bool+  rec_superCommand _ = False+   -- | Provide a summary help string for each mode. Used in help output. Again,   -- pattern match like in @run'@.   mode_summary :: cmd -> String@@ -138,6 +148,10 @@     where available = [ (KeyF (typeOf (undefined :: cmd)) opt, [enable])                       | opt <- constrFields $ rec_initial cmd]           ctor = (fromConstr $ rec_initial cmd :: cmd)++  optionStyle cmd = rec_optionStyle (fromConstr $ rec_initial cmd :: cmd)++  supercommand cmd = rec_superCommand (fromConstr $ rec_initial cmd :: cmd)    cmd_flag_empty cmd = fromConstr $ rec_initial cmd 
cmdlib.cabal view
@@ -1,5 +1,5 @@ name:        cmdlib-version:     0.3+version:     0.3.1 synopsis:    a library for command line parsing & online help  description: A commandline parsing library, based on getopt. Comes with a