dev-haskell/optparse-applicative: add 0.18.1.0

Signed-off-by: hololeap <hololeap@protonmail.com>
Signed-off-by: Sam James <sam@gentoo.org>
This commit is contained in:
hololeap 2023-10-02 23:09:01 -06:00 committed by Sam James
parent 760b884627
commit 7f96428df7
No known key found for this signature in database
GPG Key ID: 738409F520DF9190
3 changed files with 38 additions and 61 deletions

View File

@ -1,2 +1,3 @@
DIST optparse-applicative-0.16.1.0.cabal 4982 BLAKE2B 7e9fed3ff6f09f8b7994d4fd2177ade79e62bc2292dd5fa78bfdf15b0b6f7af0bd696d61ef02ed358460a61f0e2f960d01455091168687f6d2db0b07caf182f6 SHA512 31a1e01b4d0a247c10b1eec2f5bb40e518b447527736b8692846980d182ef2ac4d839b4a24b3d17414fac28700d43d0317deb481c1e0c7ac2b7b38aaafc654a1
DIST optparse-applicative-0.16.1.0.tar.gz 58315 BLAKE2B 3998ef8594abd3f0f1e85cc44a3efa19d78751f5d17181e1b203504221c219ebf3fa36ccde7351e5821fe1c4a4c0c16a20fffe92259710dbcc7656f4e3a83c50 SHA512 46bdb37b1328a6dbf271dcdb3483266c0c8412fc489e68e32b114745d9cf0108dd49df6cb565df3470121931a769f11996f5fd9fd8e9e38ed6b6853faab56710
DIST optparse-applicative-0.18.1.0.tar.gz 60682 BLAKE2B 7fc64b6d135fbec6165050e059235a34b0cbe0633076acc97f645af9e25d805ddd5bc03101823ac4645bf7c390dd6c19d96505aeb6c54a4253317b6cbc160d8a SHA512 a5a7667cadd3c2785d787cb6bddb009750308376c771f45d72e2245577f42c2946a069bf420d3404653f9f3662cb798341ee96d1ead35dbf95ab42447698e41d

View File

@ -5,68 +5,8 @@
<email>haskell@gentoo.org</email>
<name>Gentoo Haskell</name>
</maintainer>
<longdescription>
Here is a simple example of an applicative option parser:
@
data Sample = Sample
&amp;#x20; &amp;#x7b; hello :: String
&amp;#x20; , quiet :: Bool &amp;#x7d;
sample :: Parser Sample
sample = Sample
&amp;#x20; \&lt;$\&gt; strOption
&amp;#x20; ( long \"hello\"
&amp;#x20; &amp; metavar \"TARGET\"
&amp;#x20; &amp; help \"Target for the greeting\" )
&amp;#x20; \&lt;*\&gt; switch
&amp;#x20; ( long \"quiet\"
&amp;#x20; &amp; help \"Whether to be quiet\" )
@
The parser is built using applicative style starting from a set of basic
combinators. In this example, @hello@ is defined as an 'option' with a
@String@ argument, while @quiet@ is a boolean 'flag' (called 'switch').
A parser can be used like this:
@
greet :: Sample -&gt; IO ()
greet (Sample h False) = putStrLn $ \"Hello, \" ++ h
greet _ = return ()
main :: IO ()
main = execParser opts \&gt;\&gt;= greet
&amp;#x20; where
&amp;#x20; opts = info (helper \&lt;*\&gt; sample)
&amp;#x20; ( fullDesc
&amp;#x20; &amp; progDesc \"Print a greeting for TARGET\"
&amp;#x20; &amp; header \"hello - a test for optparse-applicative\" )
@
The @greet@ function is the entry point of the program, while @opts@ is a
complete description of the program, used when generating a help text. The
'helper' combinator takes any parser, and adds a @help@ option to it (which
always fails).
The @hello@ option in this example is mandatory (since it doesn't have a
default value), so running the program without any argument will display a
help text:
&gt;hello - a test for optparse-applicative
&gt;
&gt;Usage: hello --hello TARGET [--quiet]
&gt; Print a greeting for TARGET
&gt;
&gt;Available options:
&gt; -h,--help Show this help text
&gt; --hello TARGET Target for the greeting
&gt; --quiet Whether to be quiet
containing a short usage summary, and a detailed list of options with
descriptions.
</longdescription>
<upstream>
<remote-id type="hackage">optparse-applicative</remote-id>
<remote-id type="github">pcapriotti/optparse-applicative</remote-id>
</upstream>
</pkgmetadata>

View File

@ -0,0 +1,36 @@
# Copyright 1999-2023 Gentoo Authors
# Distributed under the terms of the GNU General Public License v2
EAPI=8
# ebuild generated by hackport 0.8.4.0.9999
#hackport: flags: +process
CABAL_FEATURES="lib profile haddock hoogle hscolour test-suite"
inherit haskell-cabal
DESCRIPTION="Utilities and combinators for parsing command line options"
HOMEPAGE="https://github.com/pcapriotti/optparse-applicative"
LICENSE="BSD"
SLOT="0/${PV}"
KEYWORDS="~amd64 ~arm64 ~ppc64 ~riscv ~x86"
RDEPEND="
>=dev-haskell/prettyprinter-1.7:=[profile?] <dev-haskell/prettyprinter-1.8:=[profile?]
>=dev-haskell/prettyprinter-ansi-terminal-1.1:=[profile?] <dev-haskell/prettyprinter-ansi-terminal-1.2:=[profile?]
>=dev-haskell/text-1.2:=[profile?]
>=dev-haskell/transformers-compat-0.3:=[profile?] <dev-haskell/transformers-compat-0.8:=[profile?]
>=dev-lang/ghc-8.10.6:=
"
DEPEND="${RDEPEND}
>=dev-haskell/cabal-3.2.1.0
test? (
>=dev-haskell/quickcheck-2.8 <dev-haskell/quickcheck-2.15
)
"
src_configure() {
haskell-cabal_src_configure \
--flag=process
}