simple-cmd-args 0.1.6 → 0.1.7
raw patch · 5 files changed
+43/−24 lines, 5 filessetup-changed
Files
- CHANGELOG.md +7/−4
- README.md +23/−3
- Setup.hs +0/−2
- SimpleCmdArgs.hs +8/−10
- simple-cmd-args.cabal +5/−5
CHANGELOG.md view
@@ -2,6 +2,9 @@ `simple-cmd-args` uses [PVP Versioning](https://pvp.haskell.org). +## 0.1.7 (2021-06-28)+- re-export maybeReader, eitherReader, and ReadM+ ## 0.1.6 (2020-03-25) - subcommands now have --help option - output a warning if there are duplicate commands@@ -10,15 +13,15 @@ - add Eq and Ord instances for Subcommand ## 0.1.4 (2019-10-29)-- export many, some, str-- export <$> and <*> on older ghc7+- re-export many, some, str+- re-export <$> and <*> on older ghc7 ## 0.1.3 (2019-09-12)-- export <|>+- re-export <|> ## 0.1.2 (2019-05-24) - add flagWith and flagWith'-- export Parser, auto, optional+- re-export Parser, auto, optional ## 0.1.1 (2019-04-08) - add switchWith, strOptionWith, optionWith, optionalWith,
README.md view
@@ -4,20 +4,22 @@ [](LICENSE) [](http://stackage.org/lts/package/simple-cmd-args) [](http://stackage.org/nightly/package/simple-cmd-args)-[](https://travis-ci.org/juhp/simple-cmd-args) A thin layer over optparse-applicative that avoids type plumbing for subcommands by using `Parser (IO ())`. ## Usage +```console+$ cat readme.hs+``` ```haskell import SimpleCmdArgs import Control.Applicative (some) import System.Directory main =- simpleCmdArgs Nothing "example-tool" "Longer description..." $+ simpleCmdArgs Nothing "readme example" "Longer description..." $ subcommands [ Subcommand "echo" "Print words" $ putStrLn . unwords <$> some (strArg "STR...")@@ -37,5 +39,23 @@ mkdir parents = if parents then createDirectoryIfMissing True else createDirectory ```+```console+$ ghc readme.hs+$ ./readme --help+readme example -See more [examples](https://github.com/juhp/simple-cmd-args/tree/master/examples).+Usage: readme COMMAND+ Longer description...++Available options:+ -h,--help Show this help text++Available commands:+ echo Print words+ ls List directory+ mkdir Create directory+$ ./readme echo hello world+hello world+```++See more [examples](https://github.com/juhp/simple-cmd-args/tree/main/examples).
− Setup.hs
@@ -1,2 +0,0 @@-import Distribution.Simple-main = defaultMain
SimpleCmdArgs.hs view
@@ -28,36 +28,34 @@ argumentWith, -- * Re-exports from optparse-applicative Parser,+ ReadM, auto, many,+ eitherReader,+ maybeReader, optional, some, str, (<|>),-#if (defined(MIN_VERSION_base) && MIN_VERSION_base(4,8,0))-#else+#if !MIN_VERSION_base(4,8,0) (<$>), (<*>) #endif ) where -#if (defined(MIN_VERSION_base) && MIN_VERSION_base(4,13,0))-#else+#if !MIN_VERSION_base(4,13,0) import Control.Applicative ((<|>),-#if (defined(MIN_VERSION_base) && MIN_VERSION_base(4,8,0))-#else+#if !MIN_VERSION_base(4,8,0) (<$>), (<*>) #endif ) #endif import Control.Monad (join) import Data.List (nub)-#if (defined(MIN_VERSION_base) && MIN_VERSION_base(4,8,0))-#else+#if !MIN_VERSION_base(4,8,0) import Data.Monoid (mconcat) #endif-#if (defined(MIN_VERSION_base) && MIN_VERSION_base(4,13,0))-#else+#if !MIN_VERSION_base(4,13,0) import Data.Semigroup ((<>)) #endif import Data.Version
simple-cmd-args.cabal view
@@ -1,6 +1,6 @@ cabal-version: 1.18 name: simple-cmd-args-version: 0.1.6+version: 0.1.7 synopsis: Simple command args parsing and execution description: This is a small wrapper over optparse-applicative which@@ -13,14 +13,14 @@ license-file: LICENSE author: Jens Petersen maintainer: juhpetersen@gmail.com-copyright: 2019-2020 Jens Petersen+copyright: 2019-2021 Jens Petersen category: System build-type: Simple extra-doc-files: README.md , CHANGELOG.md-tested-with: GHC == 7.4.2, GHC == 7.6.3, GHC == 7.8.4,- GHC == 7.10.3, GHC == 8.0.2, GHC == 8.2.2,- GHC == 8.4.4, GHC == 8.6.5, GHC == 8.8.3+tested-with: GHC == 7.10.3, GHC == 8.0.2, GHC == 8.2.2,+ GHC == 8.4.4, GHC == 8.6.5, GHC == 8.8.4+ GHC == 8.10.4, GHC == 9.0.1 source-repository head type: git