summaryrefslogtreecommitdiff
path: root/dev-haskell/options/metadata.xml
diff options
context:
space:
mode:
authorV3n3RiX <venerix@redcorelinux.org>2018-07-14 20:57:42 +0100
committerV3n3RiX <venerix@redcorelinux.org>2018-07-14 20:57:42 +0100
commit1798c4aeca70ac8d0a243684d6a798fbc65735f8 (patch)
treee48e19cb6fa03de18e1c63e1a93371b7ebc4eb56 /dev-haskell/options/metadata.xml
parentd87262dd706fec50cd150aab3e93883b6337466d (diff)
gentoo resync : 14.07.2018
Diffstat (limited to 'dev-haskell/options/metadata.xml')
-rw-r--r--dev-haskell/options/metadata.xml63
1 files changed, 0 insertions, 63 deletions
diff --git a/dev-haskell/options/metadata.xml b/dev-haskell/options/metadata.xml
deleted file mode 100644
index 4d7ecf23aaee..000000000000
--- a/dev-haskell/options/metadata.xml
+++ /dev/null
@@ -1,63 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<!DOCTYPE pkgmetadata SYSTEM "http://www.gentoo.org/dtd/metadata.dtd">
-<pkgmetadata>
- <maintainer type="project">
- <email>haskell@gentoo.org</email>
- <name>Gentoo Haskell</name>
- </maintainer>
- <longdescription>
- The @options@ package lets library and application developers easily work
- with command-line options.
-
- The following example is a full program that can accept two options,
- @--message@ and @--quiet@:
-
- @
- import Control.Applicative
- import Options
-
- data MainOptions = MainOptions
- &amp;#x20; &amp;#x7b; optMessage :: String
- &amp;#x20; , optQuiet :: Bool
- &amp;#x20; &amp;#x7d;
-
- instance 'Options' MainOptions where
- &amp;#x20; defineOptions = pure MainOptions
- &amp;#x20; \&lt;*\&gt; simpleOption \"message\" \"Hello world!\"
- &amp;#x20; \"A message to show the user.\"
- &amp;#x20; \&lt;*\&gt; simpleOption \"quiet\" False
- &amp;#x20; \"Whether to be quiet.\"
-
- main :: IO ()
- main = runCommand $ \\opts args -&gt; do
- &amp;#x20; if optQuiet opts
- &amp;#x20; then return ()
- &amp;#x20; else putStrLn (optMessage opts)
- @
-
- &gt;$ ./hello
- &gt;Hello world!
- &gt;$ ./hello --message='ciao mondo'
- &gt;ciao mondo
- &gt;$ ./hello --quiet
- &gt;$
-
- In addition, this library will automatically create documentation options
- such as @--help@ and @--help-all@:
-
- &gt;$ ./hello --help
- &gt;Help Options:
- &gt; -h, --help
- &gt; Show option summary.
- &gt; --help-all
- &gt; Show all help options.
- &gt;
- &gt;Application Options:
- &gt; --message :: text
- &gt; A message to show the user.
- &gt; default: "Hello world!"
- &gt; --quiet :: bool
- &gt; Whether to be quiet.
- &gt; default: false
- </longdescription>
-</pkgmetadata>