commander-cli 0.10.0.0 → 0.10.0.1
raw patch · 3 files changed
+31/−6 lines, 3 filesPVP ok
version bump matches the API change (PVP)
API changes (from Hackage documentation)
Files
- app/Main.hs +13/−1
- commander-cli.cabal +1/−1
- src/Options/Commander.hs +17/−4
app/Main.hs view
@@ -162,4 +162,16 @@ False -> Context home [] <$ createDirectory tasksFilePath main :: IO ()-main = command_ taskManager+main = command_ . toplevel @"file" $+ (sub @"maybe-read" $+ arg @"filename" \filename ->+ flag @"read" \b -> raw $+ if b+ then putStrLn =<< readFile filename+ else pure ())+ <+>+ (sub @"maybe-write" $+ opt @"file" @"file-to-write" \mfilename -> raw $+ case mfilename of+ Just filename -> putStrLn =<< readFile filename+ Nothing -> pure ())
commander-cli.cabal view
@@ -1,7 +1,7 @@ cabal-version: 2.4 name: commander-cli-version: 0.10.0.0+version: 0.10.0.1 synopsis: A command line argument/option parser library description: A command line argument/option parser library. homepage: https://github.com/SamuelSchlesinger/commander-cli
src/Options/Commander.hs view
@@ -51,9 +51,19 @@ @ usage:-file help-file maybe-read \<filename :: String\> ~read-file maybe-write -file \<file-to-write :: String\>+name: file+|++- subprogram: help+|++- subprogram: maybe-read+| |+| `- argument: filename :: [Char]+| |+| `- flag: ~read+|+`- subprogram: maybe-write+ |+ `- option: -file <file-to-write :: [Char]> @ The point of this library is mainly so that you can write command line@@ -407,7 +417,7 @@ (documentation @p)] -- | A simple default for getting out the arguments, options, and flags--- using 'getArgs'. We use the syntax ~flag for flags and ~opt+-- using 'getArgs'. We use the syntax ~flag for flags and -opt -- for options, with arguments using the typical ordered representation. initialState :: IO State initialState = do@@ -525,6 +535,9 @@ liftIO $ putStrLn "usage:" liftIO $ putStrLn (document @p) +-- | A combinator which takes a program, and a type-level 'Symbol'+-- description of that program, and produces a program here the+-- documentation is annotated with the given description. description :: forall description p m a. (HasProgram p, KnownSymbol description) => ProgramT p m a -> ProgramT (Description description & p) m a description = DescriptionProgramT