packages feed

Cabal-3.0.0.0: doc/API/Cabal/Distribution-Simple-Command.html

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"><html xmlns="http://www.w3.org/1999/xhtml"><head><meta http-equiv="Content-Type" content="text/html; charset=UTF-8" /><title>Distribution.Simple.Command</title><link href="ocean.css" rel="stylesheet" type="text/css" title="Ocean" /><link rel="stylesheet" type="text/css" href="quick-jump.css" /><script src="haddock-bundle.min.js" async="async" type="text/javascript"></script><script src="https://cdnjs.cloudflare.com/ajax/libs/mathjax/2.7.0/MathJax.js?config=TeX-AMS-MML_HTMLorMML" type="text/javascript"></script></head><body><div id="package-header"><ul class="links" id="page-menu"><li><a href="index.html">Contents</a></li><li><a href="doc-index.html">Index</a></li></ul><p class="caption">Cabal-3.0.0.0: A framework for packaging Haskell software</p></div><div id="content"><div id="module-header"><table class="info"><tr><th valign="top">Copyright</th><td>Duncan Coutts 2007</td></tr><tr><th>License</th><td>BSD3</td></tr><tr><th>Maintainer</th><td>cabal-devel@haskell.org</td></tr><tr><th>Portability</th><td>non-portable (ExistentialQuantification)</td></tr><tr><th>Safe Haskell</th><td>None</td></tr><tr><th>Language</th><td>Haskell2010</td></tr></table><p class="caption">Distribution.Simple.Command</p></div><div id="table-of-contents"><p class="caption">Contents</p><ul><li><a href="#g:1">Command interface</a><ul><li><a href="#g:2">Constructing commands</a></li><li><a href="#g:3">Associating actions with commands</a></li><li><a href="#g:4">Building lists of commands</a></li><li><a href="#g:5">Running commands</a></li></ul></li><li><a href="#g:6">Option Fields</a><ul><li><a href="#g:7">Constructing Option Fields</a></li><li><a href="#g:8">Liftings &amp; Projections</a></li></ul></li><li><a href="#g:9">Option Descriptions</a><ul><li><a href="#g:10">OptDescr <code>smart</code> constructors</a></li></ul></li></ul></div><div id="description"><p class="caption">Description</p><div class="doc"><p>This is to do with command line handling. The Cabal command line is
 organised into a number of named sub-commands (much like darcs). The
 <code><a href="Distribution-Simple-Command.html#t:CommandUI" title="Distribution.Simple.Command">CommandUI</a></code> abstraction represents one of these sub-commands, with a name,
 description, a set of flags. Commands can be associated with actions and
 run. It handles some common stuff automatically, like the <code>--help</code> and
 command line completion flags. It is designed to allow other tools make
 derived commands. This feature is used heavily in <code>cabal-install</code>.</p></div></div><div id="synopsis"><details id="syn"><summary>Synopsis</summary><ul class="details-toggle" data-details-id="syn"><li class="src short"><span class="keyword">data</span> <a href="#t:CommandUI">CommandUI</a> flags = <a href="#v:CommandUI">CommandUI</a> {<ul class="subs"><li><a href="#v:commandName">commandName</a> :: <a href="Distribution-Compat-Prelude-Internal.html#t:String" title="Distribution.Compat.Prelude.Internal">String</a></li><li><a href="#v:commandSynopsis">commandSynopsis</a> :: <a href="Distribution-Compat-Prelude-Internal.html#t:String" title="Distribution.Compat.Prelude.Internal">String</a></li><li><a href="#v:commandUsage">commandUsage</a> :: <a href="Distribution-Compat-Prelude-Internal.html#t:String" title="Distribution.Compat.Prelude.Internal">String</a> -&gt; <a href="Distribution-Compat-Prelude-Internal.html#t:String" title="Distribution.Compat.Prelude.Internal">String</a></li><li><a href="#v:commandDescription">commandDescription</a> :: <a href="Distribution-Compat-Prelude-Internal.html#t:Maybe" title="Distribution.Compat.Prelude.Internal">Maybe</a> (<a href="Distribution-Compat-Prelude-Internal.html#t:String" title="Distribution.Compat.Prelude.Internal">String</a> -&gt; <a href="Distribution-Compat-Prelude-Internal.html#t:String" title="Distribution.Compat.Prelude.Internal">String</a>)</li><li><a href="#v:commandNotes">commandNotes</a> :: <a href="Distribution-Compat-Prelude-Internal.html#t:Maybe" title="Distribution.Compat.Prelude.Internal">Maybe</a> (<a href="Distribution-Compat-Prelude-Internal.html#t:String" title="Distribution.Compat.Prelude.Internal">String</a> -&gt; <a href="Distribution-Compat-Prelude-Internal.html#t:String" title="Distribution.Compat.Prelude.Internal">String</a>)</li><li><a href="#v:commandDefaultFlags">commandDefaultFlags</a> :: flags</li><li><a href="#v:commandOptions">commandOptions</a> :: <a href="Distribution-Simple-Command.html#t:ShowOrParseArgs" title="Distribution.Simple.Command">ShowOrParseArgs</a> -&gt; [<a href="Distribution-Simple-Command.html#t:OptionField" title="Distribution.Simple.Command">OptionField</a> flags]</li></ul>}</li><li class="src short"><a href="#v:commandShowOptions">commandShowOptions</a> :: <a href="Distribution-Simple-Command.html#t:CommandUI" title="Distribution.Simple.Command">CommandUI</a> flags -&gt; flags -&gt; [<a href="Distribution-Compat-Prelude-Internal.html#t:String" title="Distribution.Compat.Prelude.Internal">String</a>]</li><li class="src short"><span class="keyword">data</span> <a href="#t:CommandParse">CommandParse</a> flags<ul class="subs"><li>= <a href="#v:CommandHelp">CommandHelp</a> (<a href="Distribution-Compat-Prelude-Internal.html#t:String" title="Distribution.Compat.Prelude.Internal">String</a> -&gt; <a href="Distribution-Compat-Prelude-Internal.html#t:String" title="Distribution.Compat.Prelude.Internal">String</a>)</li><li>| <a href="#v:CommandList">CommandList</a> [<a href="Distribution-Compat-Prelude-Internal.html#t:String" title="Distribution.Compat.Prelude.Internal">String</a>]</li><li>| <a href="#v:CommandErrors">CommandErrors</a> [<a href="Distribution-Compat-Prelude-Internal.html#t:String" title="Distribution.Compat.Prelude.Internal">String</a>]</li><li>| <a href="#v:CommandReadyToGo">CommandReadyToGo</a> flags</li></ul></li><li class="src short"><a href="#v:commandParseArgs">commandParseArgs</a> :: <a href="Distribution-Simple-Command.html#t:CommandUI" title="Distribution.Simple.Command">CommandUI</a> flags -&gt; <a href="Distribution-Compat-Prelude-Internal.html#t:Bool" title="Distribution.Compat.Prelude.Internal">Bool</a> -&gt; [<a href="Distribution-Compat-Prelude-Internal.html#t:String" title="Distribution.Compat.Prelude.Internal">String</a>] -&gt; <a href="Distribution-Simple-Command.html#t:CommandParse" title="Distribution.Simple.Command">CommandParse</a> (flags -&gt; flags, [<a href="Distribution-Compat-Prelude-Internal.html#t:String" title="Distribution.Compat.Prelude.Internal">String</a>])</li><li class="src short"><a href="#v:getNormalCommandDescriptions">getNormalCommandDescriptions</a> :: [<a href="Distribution-Simple-Command.html#t:Command" title="Distribution.Simple.Command">Command</a> action] -&gt; [(<a href="Distribution-Compat-Prelude-Internal.html#t:String" title="Distribution.Compat.Prelude.Internal">String</a>, <a href="Distribution-Compat-Prelude-Internal.html#t:String" title="Distribution.Compat.Prelude.Internal">String</a>)]</li><li class="src short"><a href="#v:helpCommandUI">helpCommandUI</a> :: <a href="Distribution-Simple-Command.html#t:CommandUI" title="Distribution.Simple.Command">CommandUI</a> ()</li><li class="src short"><span class="keyword">data</span> <a href="#t:ShowOrParseArgs">ShowOrParseArgs</a><ul class="subs"><li>= <a href="#v:ShowArgs">ShowArgs</a></li><li>| <a href="#v:ParseArgs">ParseArgs</a></li></ul></li><li class="src short"><a href="#v:usageDefault">usageDefault</a> :: <a href="Distribution-Compat-Prelude-Internal.html#t:String" title="Distribution.Compat.Prelude.Internal">String</a> -&gt; <a href="Distribution-Compat-Prelude-Internal.html#t:String" title="Distribution.Compat.Prelude.Internal">String</a> -&gt; <a href="Distribution-Compat-Prelude-Internal.html#t:String" title="Distribution.Compat.Prelude.Internal">String</a></li><li class="src short"><a href="#v:usageAlternatives">usageAlternatives</a> :: <a href="Distribution-Compat-Prelude-Internal.html#t:String" title="Distribution.Compat.Prelude.Internal">String</a> -&gt; [<a href="Distribution-Compat-Prelude-Internal.html#t:String" title="Distribution.Compat.Prelude.Internal">String</a>] -&gt; <a href="Distribution-Compat-Prelude-Internal.html#t:String" title="Distribution.Compat.Prelude.Internal">String</a> -&gt; <a href="Distribution-Compat-Prelude-Internal.html#t:String" title="Distribution.Compat.Prelude.Internal">String</a></li><li class="src short"><a href="#v:mkCommandUI">mkCommandUI</a> :: <a href="Distribution-Compat-Prelude-Internal.html#t:String" title="Distribution.Compat.Prelude.Internal">String</a> -&gt; <a href="Distribution-Compat-Prelude-Internal.html#t:String" title="Distribution.Compat.Prelude.Internal">String</a> -&gt; [<a href="Distribution-Compat-Prelude-Internal.html#t:String" title="Distribution.Compat.Prelude.Internal">String</a>] -&gt; flags -&gt; (<a href="Distribution-Simple-Command.html#t:ShowOrParseArgs" title="Distribution.Simple.Command">ShowOrParseArgs</a> -&gt; [<a href="Distribution-Simple-Command.html#t:OptionField" title="Distribution.Simple.Command">OptionField</a> flags]) -&gt; <a href="Distribution-Simple-Command.html#t:CommandUI" title="Distribution.Simple.Command">CommandUI</a> flags</li><li class="src short"><a href="#v:hiddenCommand">hiddenCommand</a> :: <a href="Distribution-Simple-Command.html#t:Command" title="Distribution.Simple.Command">Command</a> action -&gt; <a href="Distribution-Simple-Command.html#t:Command" title="Distribution.Simple.Command">Command</a> action</li><li class="src short"><span class="keyword">data</span> <a href="#t:Command">Command</a> action</li><li class="src short"><a href="#v:commandAddAction">commandAddAction</a> :: <a href="Distribution-Simple-Command.html#t:CommandUI" title="Distribution.Simple.Command">CommandUI</a> flags -&gt; (flags -&gt; [<a href="Distribution-Compat-Prelude-Internal.html#t:String" title="Distribution.Compat.Prelude.Internal">String</a>] -&gt; action) -&gt; <a href="Distribution-Simple-Command.html#t:Command" title="Distribution.Simple.Command">Command</a> action</li><li class="src short"><a href="#v:noExtraFlags">noExtraFlags</a> :: [<a href="Distribution-Compat-Prelude-Internal.html#t:String" title="Distribution.Compat.Prelude.Internal">String</a>] -&gt; <a href="Distribution-Compat-Prelude-Internal.html#t:IO" title="Distribution.Compat.Prelude.Internal">IO</a> ()</li><li class="src short"><span class="keyword">data</span> <a href="#t:CommandType">CommandType</a><ul class="subs"><li>= <a href="#v:NormalCommand">NormalCommand</a></li><li>| <a href="#v:HiddenCommand">HiddenCommand</a></li></ul></li><li class="src short"><span class="keyword">data</span> <a href="#t:CommandSpec">CommandSpec</a> action = <a href="#v:CommandSpec">CommandSpec</a> (<a href="Distribution-Simple-Command.html#t:CommandUI" title="Distribution.Simple.Command">CommandUI</a> flags) (<a href="Distribution-Simple-Command.html#t:CommandUI" title="Distribution.Simple.Command">CommandUI</a> flags -&gt; <a href="Distribution-Simple-Command.html#t:Command" title="Distribution.Simple.Command">Command</a> action) <a href="Distribution-Simple-Command.html#t:CommandType" title="Distribution.Simple.Command">CommandType</a></li><li class="src short"><a href="#v:commandFromSpec">commandFromSpec</a> :: <a href="Distribution-Simple-Command.html#t:CommandSpec" title="Distribution.Simple.Command">CommandSpec</a> a -&gt; <a href="Distribution-Simple-Command.html#t:Command" title="Distribution.Simple.Command">Command</a> a</li><li class="src short"><a href="#v:commandsRun">commandsRun</a> :: <a href="Distribution-Simple-Command.html#t:CommandUI" title="Distribution.Simple.Command">CommandUI</a> a -&gt; [<a href="Distribution-Simple-Command.html#t:Command" title="Distribution.Simple.Command">Command</a> action] -&gt; [<a href="Distribution-Compat-Prelude-Internal.html#t:String" title="Distribution.Compat.Prelude.Internal">String</a>] -&gt; <a href="Distribution-Simple-Command.html#t:CommandParse" title="Distribution.Simple.Command">CommandParse</a> (a, <a href="Distribution-Simple-Command.html#t:CommandParse" title="Distribution.Simple.Command">CommandParse</a> action)</li><li class="src short"><span class="keyword">data</span> <a href="#t:OptionField">OptionField</a> a = <a href="#v:OptionField">OptionField</a> {<ul class="subs"><li><a href="#v:optionName">optionName</a> :: <a href="Distribution-Simple-Command.html#t:Name" title="Distribution.Simple.Command">Name</a></li><li><a href="#v:optionDescr">optionDescr</a> :: [<a href="Distribution-Simple-Command.html#t:OptDescr" title="Distribution.Simple.Command">OptDescr</a> a]</li></ul>}</li><li class="src short"><span class="keyword">type</span> <a href="#t:Name">Name</a> = <a href="Distribution-Compat-Prelude-Internal.html#t:String" title="Distribution.Compat.Prelude.Internal">String</a></li><li class="src short"><a href="#v:option">option</a> :: <a href="Distribution-Simple-Command.html#t:SFlags" title="Distribution.Simple.Command">SFlags</a> -&gt; <a href="Distribution-Simple-Command.html#t:LFlags" title="Distribution.Simple.Command">LFlags</a> -&gt; <a href="Distribution-Simple-Command.html#t:Description" title="Distribution.Simple.Command">Description</a> -&gt; get -&gt; set -&gt; <a href="Distribution-Simple-Command.html#t:MkOptDescr" title="Distribution.Simple.Command">MkOptDescr</a> get set a -&gt; <a href="Distribution-Simple-Command.html#t:OptionField" title="Distribution.Simple.Command">OptionField</a> a</li><li class="src short"><a href="#v:multiOption">multiOption</a> :: <a href="Distribution-Simple-Command.html#t:Name" title="Distribution.Simple.Command">Name</a> -&gt; get -&gt; set -&gt; [get -&gt; set -&gt; <a href="Distribution-Simple-Command.html#t:OptDescr" title="Distribution.Simple.Command">OptDescr</a> a] -&gt; <a href="Distribution-Simple-Command.html#t:OptionField" title="Distribution.Simple.Command">OptionField</a> a</li><li class="src short"><a href="#v:liftOption">liftOption</a> :: (b -&gt; a) -&gt; (a -&gt; b -&gt; b) -&gt; <a href="Distribution-Simple-Command.html#t:OptionField" title="Distribution.Simple.Command">OptionField</a> a -&gt; <a href="Distribution-Simple-Command.html#t:OptionField" title="Distribution.Simple.Command">OptionField</a> b</li><li class="src short"><span class="keyword">data</span> <a href="#t:OptDescr">OptDescr</a> a<ul class="subs"><li>= <a href="#v:ReqArg">ReqArg</a> <a href="Distribution-Simple-Command.html#t:Description" title="Distribution.Simple.Command">Description</a> <a href="Distribution-Simple-Command.html#t:OptFlags" title="Distribution.Simple.Command">OptFlags</a> <a href="Distribution-Simple-Command.html#t:ArgPlaceHolder" title="Distribution.Simple.Command">ArgPlaceHolder</a> (<a href="Distribution-ReadE.html#t:ReadE" title="Distribution.ReadE">ReadE</a> (a -&gt; a)) (a -&gt; [<a href="Distribution-Compat-Prelude-Internal.html#t:String" title="Distribution.Compat.Prelude.Internal">String</a>])</li><li>| <a href="#v:OptArg">OptArg</a> <a href="Distribution-Simple-Command.html#t:Description" title="Distribution.Simple.Command">Description</a> <a href="Distribution-Simple-Command.html#t:OptFlags" title="Distribution.Simple.Command">OptFlags</a> <a href="Distribution-Simple-Command.html#t:ArgPlaceHolder" title="Distribution.Simple.Command">ArgPlaceHolder</a> (<a href="Distribution-ReadE.html#t:ReadE" title="Distribution.ReadE">ReadE</a> (a -&gt; a)) (a -&gt; a) (a -&gt; [<a href="Distribution-Compat-Prelude-Internal.html#t:Maybe" title="Distribution.Compat.Prelude.Internal">Maybe</a> <a href="Distribution-Compat-Prelude-Internal.html#t:String" title="Distribution.Compat.Prelude.Internal">String</a>])</li><li>| <a href="#v:ChoiceOpt">ChoiceOpt</a> [(<a href="Distribution-Simple-Command.html#t:Description" title="Distribution.Simple.Command">Description</a>, <a href="Distribution-Simple-Command.html#t:OptFlags" title="Distribution.Simple.Command">OptFlags</a>, a -&gt; a, a -&gt; <a href="Distribution-Compat-Prelude-Internal.html#t:Bool" title="Distribution.Compat.Prelude.Internal">Bool</a>)]</li><li>| <a href="#v:BoolOpt">BoolOpt</a> <a href="Distribution-Simple-Command.html#t:Description" title="Distribution.Simple.Command">Description</a> <a href="Distribution-Simple-Command.html#t:OptFlags" title="Distribution.Simple.Command">OptFlags</a> <a href="Distribution-Simple-Command.html#t:OptFlags" title="Distribution.Simple.Command">OptFlags</a> (<a href="Distribution-Compat-Prelude-Internal.html#t:Bool" title="Distribution.Compat.Prelude.Internal">Bool</a> -&gt; a -&gt; a) (a -&gt; <a href="Distribution-Compat-Prelude-Internal.html#t:Maybe" title="Distribution.Compat.Prelude.Internal">Maybe</a> <a href="Distribution-Compat-Prelude-Internal.html#t:Bool" title="Distribution.Compat.Prelude.Internal">Bool</a>)</li></ul></li><li class="src short"><span class="keyword">type</span> <a href="#t:Description">Description</a> = <a href="Distribution-Compat-Prelude-Internal.html#t:String" title="Distribution.Compat.Prelude.Internal">String</a></li><li class="src short"><span class="keyword">type</span> <a href="#t:SFlags">SFlags</a> = [<a href="Distribution-Compat-Prelude-Internal.html#t:Char" title="Distribution.Compat.Prelude.Internal">Char</a>]</li><li class="src short"><span class="keyword">type</span> <a href="#t:LFlags">LFlags</a> = [<a href="Distribution-Compat-Prelude-Internal.html#t:String" title="Distribution.Compat.Prelude.Internal">String</a>]</li><li class="src short"><span class="keyword">type</span> <a href="#t:OptFlags">OptFlags</a> = (<a href="Distribution-Simple-Command.html#t:SFlags" title="Distribution.Simple.Command">SFlags</a>, <a href="Distribution-Simple-Command.html#t:LFlags" title="Distribution.Simple.Command">LFlags</a>)</li><li class="src short"><span class="keyword">type</span> <a href="#t:ArgPlaceHolder">ArgPlaceHolder</a> = <a href="Distribution-Compat-Prelude-Internal.html#t:String" title="Distribution.Compat.Prelude.Internal">String</a></li><li class="src short"><span class="keyword">type</span> <a href="#t:MkOptDescr">MkOptDescr</a> get set a = <a href="Distribution-Simple-Command.html#t:SFlags" title="Distribution.Simple.Command">SFlags</a> -&gt; <a href="Distribution-Simple-Command.html#t:LFlags" title="Distribution.Simple.Command">LFlags</a> -&gt; <a href="Distribution-Simple-Command.html#t:Description" title="Distribution.Simple.Command">Description</a> -&gt; get -&gt; set -&gt; <a href="Distribution-Simple-Command.html#t:OptDescr" title="Distribution.Simple.Command">OptDescr</a> a</li><li class="src short"><a href="#v:reqArg">reqArg</a> :: <a href="Distribution-Compat-Semigroup.html#t:Monoid" title="Distribution.Compat.Semigroup">Monoid</a> b =&gt; <a href="Distribution-Simple-Command.html#t:ArgPlaceHolder" title="Distribution.Simple.Command">ArgPlaceHolder</a> -&gt; <a href="Distribution-ReadE.html#t:ReadE" title="Distribution.ReadE">ReadE</a> b -&gt; (b -&gt; [<a href="Distribution-Compat-Prelude-Internal.html#t:String" title="Distribution.Compat.Prelude.Internal">String</a>]) -&gt; <a href="Distribution-Simple-Command.html#t:MkOptDescr" title="Distribution.Simple.Command">MkOptDescr</a> (a -&gt; b) (b -&gt; a -&gt; a) a</li><li class="src short"><a href="#v:reqArg-39-">reqArg'</a> :: <a href="Distribution-Compat-Semigroup.html#t:Monoid" title="Distribution.Compat.Semigroup">Monoid</a> b =&gt; <a href="Distribution-Simple-Command.html#t:ArgPlaceHolder" title="Distribution.Simple.Command">ArgPlaceHolder</a> -&gt; (<a href="Distribution-Compat-Prelude-Internal.html#t:String" title="Distribution.Compat.Prelude.Internal">String</a> -&gt; b) -&gt; (b -&gt; [<a href="Distribution-Compat-Prelude-Internal.html#t:String" title="Distribution.Compat.Prelude.Internal">String</a>]) -&gt; <a href="Distribution-Simple-Command.html#t:MkOptDescr" title="Distribution.Simple.Command">MkOptDescr</a> (a -&gt; b) (b -&gt; a -&gt; a) a</li><li class="src short"><a href="#v:optArg">optArg</a> :: <a href="Distribution-Compat-Semigroup.html#t:Monoid" title="Distribution.Compat.Semigroup">Monoid</a> b =&gt; <a href="Distribution-Simple-Command.html#t:ArgPlaceHolder" title="Distribution.Simple.Command">ArgPlaceHolder</a> -&gt; <a href="Distribution-ReadE.html#t:ReadE" title="Distribution.ReadE">ReadE</a> b -&gt; b -&gt; (b -&gt; [<a href="Distribution-Compat-Prelude-Internal.html#t:Maybe" title="Distribution.Compat.Prelude.Internal">Maybe</a> <a href="Distribution-Compat-Prelude-Internal.html#t:String" title="Distribution.Compat.Prelude.Internal">String</a>]) -&gt; <a href="Distribution-Simple-Command.html#t:MkOptDescr" title="Distribution.Simple.Command">MkOptDescr</a> (a -&gt; b) (b -&gt; a -&gt; a) a</li><li class="src short"><a href="#v:optArg-39-">optArg'</a> :: <a href="Distribution-Compat-Semigroup.html#t:Monoid" title="Distribution.Compat.Semigroup">Monoid</a> b =&gt; <a href="Distribution-Simple-Command.html#t:ArgPlaceHolder" title="Distribution.Simple.Command">ArgPlaceHolder</a> -&gt; (<a href="Distribution-Compat-Prelude-Internal.html#t:Maybe" title="Distribution.Compat.Prelude.Internal">Maybe</a> <a href="Distribution-Compat-Prelude-Internal.html#t:String" title="Distribution.Compat.Prelude.Internal">String</a> -&gt; b) -&gt; (b -&gt; [<a href="Distribution-Compat-Prelude-Internal.html#t:Maybe" title="Distribution.Compat.Prelude.Internal">Maybe</a> <a href="Distribution-Compat-Prelude-Internal.html#t:String" title="Distribution.Compat.Prelude.Internal">String</a>]) -&gt; <a href="Distribution-Simple-Command.html#t:MkOptDescr" title="Distribution.Simple.Command">MkOptDescr</a> (a -&gt; b) (b -&gt; a -&gt; a) a</li><li class="src short"><a href="#v:noArg">noArg</a> :: <a href="Distribution-Compat-Prelude-Internal.html#t:Eq" title="Distribution.Compat.Prelude.Internal">Eq</a> b =&gt; b -&gt; <a href="Distribution-Simple-Command.html#t:MkOptDescr" title="Distribution.Simple.Command">MkOptDescr</a> (a -&gt; b) (b -&gt; a -&gt; a) a</li><li class="src short"><a href="#v:boolOpt">boolOpt</a> :: (b -&gt; <a href="Distribution-Compat-Prelude-Internal.html#t:Maybe" title="Distribution.Compat.Prelude.Internal">Maybe</a> <a href="Distribution-Compat-Prelude-Internal.html#t:Bool" title="Distribution.Compat.Prelude.Internal">Bool</a>) -&gt; (<a href="Distribution-Compat-Prelude-Internal.html#t:Bool" title="Distribution.Compat.Prelude.Internal">Bool</a> -&gt; b) -&gt; <a href="Distribution-Simple-Command.html#t:SFlags" title="Distribution.Simple.Command">SFlags</a> -&gt; <a href="Distribution-Simple-Command.html#t:SFlags" title="Distribution.Simple.Command">SFlags</a> -&gt; <a href="Distribution-Simple-Command.html#t:MkOptDescr" title="Distribution.Simple.Command">MkOptDescr</a> (a -&gt; b) (b -&gt; a -&gt; a) a</li><li class="src short"><a href="#v:boolOpt-39-">boolOpt'</a> :: (b -&gt; <a href="Distribution-Compat-Prelude-Internal.html#t:Maybe" title="Distribution.Compat.Prelude.Internal">Maybe</a> <a href="Distribution-Compat-Prelude-Internal.html#t:Bool" title="Distribution.Compat.Prelude.Internal">Bool</a>) -&gt; (<a href="Distribution-Compat-Prelude-Internal.html#t:Bool" title="Distribution.Compat.Prelude.Internal">Bool</a> -&gt; b) -&gt; <a href="Distribution-Simple-Command.html#t:OptFlags" title="Distribution.Simple.Command">OptFlags</a> -&gt; <a href="Distribution-Simple-Command.html#t:OptFlags" title="Distribution.Simple.Command">OptFlags</a> -&gt; <a href="Distribution-Simple-Command.html#t:MkOptDescr" title="Distribution.Simple.Command">MkOptDescr</a> (a -&gt; b) (b -&gt; a -&gt; a) a</li><li class="src short"><a href="#v:choiceOpt">choiceOpt</a> :: <a href="Distribution-Compat-Prelude-Internal.html#t:Eq" title="Distribution.Compat.Prelude.Internal">Eq</a> b =&gt; [(b, <a href="Distribution-Simple-Command.html#t:OptFlags" title="Distribution.Simple.Command">OptFlags</a>, <a href="Distribution-Simple-Command.html#t:Description" title="Distribution.Simple.Command">Description</a>)] -&gt; <a href="Distribution-Simple-Command.html#t:MkOptDescr" title="Distribution.Simple.Command">MkOptDescr</a> (a -&gt; b) (b -&gt; a -&gt; a) a</li><li class="src short"><a href="#v:choiceOptFromEnum">choiceOptFromEnum</a> :: (<a href="Distribution-Compat-Prelude-Internal.html#t:Bounded" title="Distribution.Compat.Prelude.Internal">Bounded</a> b, <a href="Distribution-Compat-Prelude-Internal.html#t:Enum" title="Distribution.Compat.Prelude.Internal">Enum</a> b, <a href="Distribution-Compat-Prelude-Internal.html#t:Show" title="Distribution.Compat.Prelude.Internal">Show</a> b, <a href="Distribution-Compat-Prelude-Internal.html#t:Eq" title="Distribution.Compat.Prelude.Internal">Eq</a> b) =&gt; <a href="Distribution-Simple-Command.html#t:MkOptDescr" title="Distribution.Simple.Command">MkOptDescr</a> (a -&gt; b) (b -&gt; a -&gt; a) a</li></ul></details></div><div id="interface"><a href="#g:1" id="g:1"><h1>Command interface</h1></a><div class="top"><p class="src"><span class="keyword">data</span> <a id="t:CommandUI" class="def">CommandUI</a> flags <a href="#t:CommandUI" class="selflink">#</a></p><div class="subs constructors"><p class="caption">Constructors</p><table><tr><td class="src"><a id="v:CommandUI" class="def">CommandUI</a></td><td class="doc empty">&nbsp;</td></tr><tr><td colspan="2"><div class="subs fields"><p class="caption">Fields</p><ul><li><dfn class="src"><a id="v:commandName" class="def">commandName</a> :: <a href="Distribution-Compat-Prelude-Internal.html#t:String" title="Distribution.Compat.Prelude.Internal">String</a></dfn><div class="doc"><p>The name of the command as it would be entered on the command line.
 For example <code>&quot;build&quot;</code>.</p></div></li><li><dfn class="src"><a id="v:commandSynopsis" class="def">commandSynopsis</a> :: <a href="Distribution-Compat-Prelude-Internal.html#t:String" title="Distribution.Compat.Prelude.Internal">String</a></dfn><div class="doc"><p>A short, one line description of the command to use in help texts.</p></div></li><li><dfn class="src"><a id="v:commandUsage" class="def">commandUsage</a> :: <a href="Distribution-Compat-Prelude-Internal.html#t:String" title="Distribution.Compat.Prelude.Internal">String</a> -&gt; <a href="Distribution-Compat-Prelude-Internal.html#t:String" title="Distribution.Compat.Prelude.Internal">String</a></dfn><div class="doc"><p>A function that maps a program name to a usage summary for this
 command.</p></div></li><li><dfn class="src"><a id="v:commandDescription" class="def">commandDescription</a> :: <a href="Distribution-Compat-Prelude-Internal.html#t:Maybe" title="Distribution.Compat.Prelude.Internal">Maybe</a> (<a href="Distribution-Compat-Prelude-Internal.html#t:String" title="Distribution.Compat.Prelude.Internal">String</a> -&gt; <a href="Distribution-Compat-Prelude-Internal.html#t:String" title="Distribution.Compat.Prelude.Internal">String</a>)</dfn><div class="doc"><p>Additional explanation of the command to use in help texts.</p></div></li><li><dfn class="src"><a id="v:commandNotes" class="def">commandNotes</a> :: <a href="Distribution-Compat-Prelude-Internal.html#t:Maybe" title="Distribution.Compat.Prelude.Internal">Maybe</a> (<a href="Distribution-Compat-Prelude-Internal.html#t:String" title="Distribution.Compat.Prelude.Internal">String</a> -&gt; <a href="Distribution-Compat-Prelude-Internal.html#t:String" title="Distribution.Compat.Prelude.Internal">String</a>)</dfn><div class="doc"><p>Post-Usage notes and examples in help texts</p></div></li><li><dfn class="src"><a id="v:commandDefaultFlags" class="def">commandDefaultFlags</a> :: flags</dfn><div class="doc"><p>Initial / empty flags</p></div></li><li><dfn class="src"><a id="v:commandOptions" class="def">commandOptions</a> :: <a href="Distribution-Simple-Command.html#t:ShowOrParseArgs" title="Distribution.Simple.Command">ShowOrParseArgs</a> -&gt; [<a href="Distribution-Simple-Command.html#t:OptionField" title="Distribution.Simple.Command">OptionField</a> flags]</dfn><div class="doc"><p>All the Option fields for this command</p></div></li></ul></div></td></tr></table></div></div><div class="top"><p class="src"><a id="v:commandShowOptions" class="def">commandShowOptions</a> :: <a href="Distribution-Simple-Command.html#t:CommandUI" title="Distribution.Simple.Command">CommandUI</a> flags -&gt; flags -&gt; [<a href="Distribution-Compat-Prelude-Internal.html#t:String" title="Distribution.Compat.Prelude.Internal">String</a>] <a href="#v:commandShowOptions" class="selflink">#</a></p><div class="doc"><p>Show flags in the standard long option command line format</p></div></div><div class="top"><p class="src"><span class="keyword">data</span> <a id="t:CommandParse" class="def">CommandParse</a> flags <a href="#t:CommandParse" class="selflink">#</a></p><div class="subs constructors"><p class="caption">Constructors</p><table><tr><td class="src"><a id="v:CommandHelp" class="def">CommandHelp</a> (<a href="Distribution-Compat-Prelude-Internal.html#t:String" title="Distribution.Compat.Prelude.Internal">String</a> -&gt; <a href="Distribution-Compat-Prelude-Internal.html#t:String" title="Distribution.Compat.Prelude.Internal">String</a>)</td><td class="doc empty">&nbsp;</td></tr><tr><td class="src"><a id="v:CommandList" class="def">CommandList</a> [<a href="Distribution-Compat-Prelude-Internal.html#t:String" title="Distribution.Compat.Prelude.Internal">String</a>]</td><td class="doc empty">&nbsp;</td></tr><tr><td class="src"><a id="v:CommandErrors" class="def">CommandErrors</a> [<a href="Distribution-Compat-Prelude-Internal.html#t:String" title="Distribution.Compat.Prelude.Internal">String</a>]</td><td class="doc empty">&nbsp;</td></tr><tr><td class="src"><a id="v:CommandReadyToGo" class="def">CommandReadyToGo</a> flags</td><td class="doc empty">&nbsp;</td></tr></table></div><div class="subs instances"><details id="i:CommandParse" open="open"><summary>Instances</summary><table><tr><td class="src clearfix"><span class="inst-left"><span class="instance details-toggle-control details-toggle" data-details-id="i:id:CommandParse:Functor:1"></span> <a href="Distribution-Compat-Prelude-Internal.html#t:Functor" title="Distribution.Compat.Prelude.Internal">Functor</a> <a href="Distribution-Simple-Command.html#t:CommandParse" title="Distribution.Simple.Command">CommandParse</a></span> <a href="#t:CommandParse" class="selflink">#</a></td><td class="doc empty">&nbsp;</td></tr><tr><td colspan="2"><details id="i:id:CommandParse:Functor:1"><summary class="hide-when-js-enabled">Instance details</summary><p>Defined in <a href="Distribution-Simple-Command.html">Distribution.Simple.Command</a></p> <div class="subs methods"><p class="caption">Methods</p><p class="src"><a href="#v:fmap">fmap</a> :: (a -&gt; b) -&gt; <a href="Distribution-Simple-Command.html#t:CommandParse" title="Distribution.Simple.Command">CommandParse</a> a -&gt; <a href="Distribution-Simple-Command.html#t:CommandParse" title="Distribution.Simple.Command">CommandParse</a> b <a href="#v:fmap" class="selflink">#</a></p><p class="src"><a href="#v:-60--36-">(&lt;$)</a> :: a -&gt; <a href="Distribution-Simple-Command.html#t:CommandParse" title="Distribution.Simple.Command">CommandParse</a> b -&gt; <a href="Distribution-Simple-Command.html#t:CommandParse" title="Distribution.Simple.Command">CommandParse</a> a <a href="#v:-60--36-" class="selflink">#</a></p></div></details></td></tr></table></details></div></div><div class="top"><p class="src"><a id="v:commandParseArgs" class="def">commandParseArgs</a> <a href="#v:commandParseArgs" class="selflink">#</a></p><div class="subs arguments"><p class="caption">Arguments</p><table><tr><td class="src">:: <a href="Distribution-Simple-Command.html#t:CommandUI" title="Distribution.Simple.Command">CommandUI</a> flags</td><td class="doc empty">&nbsp;</td></tr><tr><td class="src">-&gt; <a href="Distribution-Compat-Prelude-Internal.html#t:Bool" title="Distribution.Compat.Prelude.Internal">Bool</a></td><td class="doc"><p>Is the command a global or subcommand?</p></td></tr><tr><td class="src">-&gt; [<a href="Distribution-Compat-Prelude-Internal.html#t:String" title="Distribution.Compat.Prelude.Internal">String</a>]</td><td class="doc empty">&nbsp;</td></tr><tr><td class="src">-&gt; <a href="Distribution-Simple-Command.html#t:CommandParse" title="Distribution.Simple.Command">CommandParse</a> (flags -&gt; flags, [<a href="Distribution-Compat-Prelude-Internal.html#t:String" title="Distribution.Compat.Prelude.Internal">String</a>])</td><td class="doc empty">&nbsp;</td></tr></table></div><div class="doc"><p>Parse a bunch of command line arguments</p></div></div><div class="top"><p class="src"><a id="v:getNormalCommandDescriptions" class="def">getNormalCommandDescriptions</a> :: [<a href="Distribution-Simple-Command.html#t:Command" title="Distribution.Simple.Command">Command</a> action] -&gt; [(<a href="Distribution-Compat-Prelude-Internal.html#t:String" title="Distribution.Compat.Prelude.Internal">String</a>, <a href="Distribution-Compat-Prelude-Internal.html#t:String" title="Distribution.Compat.Prelude.Internal">String</a>)] <a href="#v:getNormalCommandDescriptions" class="selflink">#</a></p><div class="doc"><p>Helper function for creating globalCommand description</p></div></div><div class="top"><p class="src"><a id="v:helpCommandUI" class="def">helpCommandUI</a> :: <a href="Distribution-Simple-Command.html#t:CommandUI" title="Distribution.Simple.Command">CommandUI</a> () <a href="#v:helpCommandUI" class="selflink">#</a></p></div><a href="#g:2" id="g:2"><h2>Constructing commands</h2></a><div class="top"><p class="src"><span class="keyword">data</span> <a id="t:ShowOrParseArgs" class="def">ShowOrParseArgs</a> <a href="#t:ShowOrParseArgs" class="selflink">#</a></p><div class="subs constructors"><p class="caption">Constructors</p><table><tr><td class="src"><a id="v:ShowArgs" class="def">ShowArgs</a></td><td class="doc empty">&nbsp;</td></tr><tr><td class="src"><a id="v:ParseArgs" class="def">ParseArgs</a></td><td class="doc empty">&nbsp;</td></tr></table></div></div><div class="top"><p class="src"><a id="v:usageDefault" class="def">usageDefault</a> :: <a href="Distribution-Compat-Prelude-Internal.html#t:String" title="Distribution.Compat.Prelude.Internal">String</a> -&gt; <a href="Distribution-Compat-Prelude-Internal.html#t:String" title="Distribution.Compat.Prelude.Internal">String</a> -&gt; <a href="Distribution-Compat-Prelude-Internal.html#t:String" title="Distribution.Compat.Prelude.Internal">String</a> <a href="#v:usageDefault" class="selflink">#</a></p><div class="doc"><p>Default &quot;usage&quot; documentation text for commands.</p></div></div><div class="top"><p class="src"><a id="v:usageAlternatives" class="def">usageAlternatives</a> :: <a href="Distribution-Compat-Prelude-Internal.html#t:String" title="Distribution.Compat.Prelude.Internal">String</a> -&gt; [<a href="Distribution-Compat-Prelude-Internal.html#t:String" title="Distribution.Compat.Prelude.Internal">String</a>] -&gt; <a href="Distribution-Compat-Prelude-Internal.html#t:String" title="Distribution.Compat.Prelude.Internal">String</a> -&gt; <a href="Distribution-Compat-Prelude-Internal.html#t:String" title="Distribution.Compat.Prelude.Internal">String</a> <a href="#v:usageAlternatives" class="selflink">#</a></p><div class="doc"><p>Create &quot;usage&quot; documentation from a list of parameter
   configurations.</p></div></div><div class="top"><p class="src"><a id="v:mkCommandUI" class="def">mkCommandUI</a> <a href="#v:mkCommandUI" class="selflink">#</a></p><div class="subs arguments"><p class="caption">Arguments</p><table><tr><td class="src">:: <a href="Distribution-Compat-Prelude-Internal.html#t:String" title="Distribution.Compat.Prelude.Internal">String</a></td><td class="doc"><p>name</p></td></tr><tr><td class="src">-&gt; <a href="Distribution-Compat-Prelude-Internal.html#t:String" title="Distribution.Compat.Prelude.Internal">String</a></td><td class="doc"><p>synopsis</p></td></tr><tr><td class="src">-&gt; [<a href="Distribution-Compat-Prelude-Internal.html#t:String" title="Distribution.Compat.Prelude.Internal">String</a>]</td><td class="doc"><p>usage alternatives</p></td></tr><tr><td class="src">-&gt; flags</td><td class="doc"><p>initial/empty flags</p></td></tr><tr><td class="src">-&gt; (<a href="Distribution-Simple-Command.html#t:ShowOrParseArgs" title="Distribution.Simple.Command">ShowOrParseArgs</a> -&gt; [<a href="Distribution-Simple-Command.html#t:OptionField" title="Distribution.Simple.Command">OptionField</a> flags])</td><td class="doc"><p>options</p></td></tr><tr><td class="src">-&gt; <a href="Distribution-Simple-Command.html#t:CommandUI" title="Distribution.Simple.Command">CommandUI</a> flags</td><td class="doc empty">&nbsp;</td></tr></table></div><div class="doc"><p>Make a Command from standard <code>GetOpt</code> options.</p></div></div><div class="top"><p class="src"><a id="v:hiddenCommand" class="def">hiddenCommand</a> :: <a href="Distribution-Simple-Command.html#t:Command" title="Distribution.Simple.Command">Command</a> action -&gt; <a href="Distribution-Simple-Command.html#t:Command" title="Distribution.Simple.Command">Command</a> action <a href="#v:hiddenCommand" class="selflink">#</a></p><div class="doc"><p>Mark command as hidden. Hidden commands don't show up in the 'progname
 help' or 'progname --help' output.</p></div></div><a href="#g:3" id="g:3"><h2>Associating actions with commands</h2></a><div class="top"><p class="src"><span class="keyword">data</span> <a id="t:Command" class="def">Command</a> action <a href="#t:Command" class="selflink">#</a></p></div><div class="top"><p class="src"><a id="v:commandAddAction" class="def">commandAddAction</a> :: <a href="Distribution-Simple-Command.html#t:CommandUI" title="Distribution.Simple.Command">CommandUI</a> flags -&gt; (flags -&gt; [<a href="Distribution-Compat-Prelude-Internal.html#t:String" title="Distribution.Compat.Prelude.Internal">String</a>] -&gt; action) -&gt; <a href="Distribution-Simple-Command.html#t:Command" title="Distribution.Simple.Command">Command</a> action <a href="#v:commandAddAction" class="selflink">#</a></p></div><div class="top"><p class="src"><a id="v:noExtraFlags" class="def">noExtraFlags</a> :: [<a href="Distribution-Compat-Prelude-Internal.html#t:String" title="Distribution.Compat.Prelude.Internal">String</a>] -&gt; <a href="Distribution-Compat-Prelude-Internal.html#t:IO" title="Distribution.Compat.Prelude.Internal">IO</a> () <a href="#v:noExtraFlags" class="selflink">#</a></p><div class="doc"><p>Utility function, many commands do not accept additional flags. This
 action fails with a helpful error message if the user supplies any extra.</p></div></div><a href="#g:4" id="g:4"><h2>Building lists of commands</h2></a><div class="top"><p class="src"><span class="keyword">data</span> <a id="t:CommandType" class="def">CommandType</a> <a href="#t:CommandType" class="selflink">#</a></p><div class="subs constructors"><p class="caption">Constructors</p><table><tr><td class="src"><a id="v:NormalCommand" class="def">NormalCommand</a></td><td class="doc empty">&nbsp;</td></tr><tr><td class="src"><a id="v:HiddenCommand" class="def">HiddenCommand</a></td><td class="doc empty">&nbsp;</td></tr></table></div></div><div class="top"><p class="src"><span class="keyword">data</span> <a id="t:CommandSpec" class="def">CommandSpec</a> action <a href="#t:CommandSpec" class="selflink">#</a></p><div class="doc"><p>wraps a <code>CommandUI</code> together with a function that turns it into a <code>Command</code>.
 By hiding the type of flags for the UI allows construction of a list of all UIs at the
 top level of the program. That list can then be used for generation of manual page
 as well as for executing the selected command.</p></div><div class="subs constructors"><p class="caption">Constructors</p><table><tr><td class="src"><a id="v:CommandSpec" class="def">CommandSpec</a> (<a href="Distribution-Simple-Command.html#t:CommandUI" title="Distribution.Simple.Command">CommandUI</a> flags) (<a href="Distribution-Simple-Command.html#t:CommandUI" title="Distribution.Simple.Command">CommandUI</a> flags -&gt; <a href="Distribution-Simple-Command.html#t:Command" title="Distribution.Simple.Command">Command</a> action) <a href="Distribution-Simple-Command.html#t:CommandType" title="Distribution.Simple.Command">CommandType</a></td><td class="doc empty">&nbsp;</td></tr></table></div></div><div class="top"><p class="src"><a id="v:commandFromSpec" class="def">commandFromSpec</a> :: <a href="Distribution-Simple-Command.html#t:CommandSpec" title="Distribution.Simple.Command">CommandSpec</a> a -&gt; <a href="Distribution-Simple-Command.html#t:Command" title="Distribution.Simple.Command">Command</a> a <a href="#v:commandFromSpec" class="selflink">#</a></p></div><a href="#g:5" id="g:5"><h2>Running commands</h2></a><div class="top"><p class="src"><a id="v:commandsRun" class="def">commandsRun</a> :: <a href="Distribution-Simple-Command.html#t:CommandUI" title="Distribution.Simple.Command">CommandUI</a> a -&gt; [<a href="Distribution-Simple-Command.html#t:Command" title="Distribution.Simple.Command">Command</a> action] -&gt; [<a href="Distribution-Compat-Prelude-Internal.html#t:String" title="Distribution.Compat.Prelude.Internal">String</a>] -&gt; <a href="Distribution-Simple-Command.html#t:CommandParse" title="Distribution.Simple.Command">CommandParse</a> (a, <a href="Distribution-Simple-Command.html#t:CommandParse" title="Distribution.Simple.Command">CommandParse</a> action) <a href="#v:commandsRun" class="selflink">#</a></p></div><a href="#g:6" id="g:6"><h1>Option Fields</h1></a><div class="top"><p class="src"><span class="keyword">data</span> <a id="t:OptionField" class="def">OptionField</a> a <a href="#t:OptionField" class="selflink">#</a></p><div class="doc"><p>We usually have a data type for storing configuration values, where
   every field stores a configuration option, and the user sets
   the value either via command line flags or a configuration file.
   An individual OptionField models such a field, and we usually
   build a list of options associated to a configuration data type.</p></div><div class="subs constructors"><p class="caption">Constructors</p><table><tr><td class="src"><a id="v:OptionField" class="def">OptionField</a></td><td class="doc empty">&nbsp;</td></tr><tr><td colspan="2"><div class="subs fields"><p class="caption">Fields</p><ul><li><dfn class="src"><a id="v:optionName" class="def">optionName</a> :: <a href="Distribution-Simple-Command.html#t:Name" title="Distribution.Simple.Command">Name</a></dfn><div class="doc empty">&nbsp;</div></li><li><dfn class="src"><a id="v:optionDescr" class="def">optionDescr</a> :: [<a href="Distribution-Simple-Command.html#t:OptDescr" title="Distribution.Simple.Command">OptDescr</a> a]</dfn><div class="doc empty">&nbsp;</div></li></ul></div></td></tr></table></div></div><div class="top"><p class="src"><span class="keyword">type</span> <a id="t:Name" class="def">Name</a> = <a href="Distribution-Compat-Prelude-Internal.html#t:String" title="Distribution.Compat.Prelude.Internal">String</a> <a href="#t:Name" class="selflink">#</a></p></div><a href="#g:7" id="g:7"><h2>Constructing Option Fields</h2></a><div class="top"><p class="src"><a id="v:option" class="def">option</a> :: <a href="Distribution-Simple-Command.html#t:SFlags" title="Distribution.Simple.Command">SFlags</a> -&gt; <a href="Distribution-Simple-Command.html#t:LFlags" title="Distribution.Simple.Command">LFlags</a> -&gt; <a href="Distribution-Simple-Command.html#t:Description" title="Distribution.Simple.Command">Description</a> -&gt; get -&gt; set -&gt; <a href="Distribution-Simple-Command.html#t:MkOptDescr" title="Distribution.Simple.Command">MkOptDescr</a> get set a -&gt; <a href="Distribution-Simple-Command.html#t:OptionField" title="Distribution.Simple.Command">OptionField</a> a <a href="#v:option" class="selflink">#</a></p><div class="doc"><p>Create an option taking a single OptDescr.
   No explicit Name is given for the Option, the name is the first LFlag given.</p></div></div><div class="top"><p class="src"><a id="v:multiOption" class="def">multiOption</a> <a href="#v:multiOption" class="selflink">#</a></p><div class="subs arguments"><p class="caption">Arguments</p><table><tr><td class="src">:: <a href="Distribution-Simple-Command.html#t:Name" title="Distribution.Simple.Command">Name</a></td><td class="doc empty">&nbsp;</td></tr><tr><td class="src">-&gt; get</td><td class="doc empty">&nbsp;</td></tr><tr><td class="src">-&gt; set</td><td class="doc empty">&nbsp;</td></tr><tr><td class="src">-&gt; [get -&gt; set -&gt; <a href="Distribution-Simple-Command.html#t:OptDescr" title="Distribution.Simple.Command">OptDescr</a> a]</td><td class="doc"><p>MkOptDescr constructors partially
 applied to flags and description.</p></td></tr><tr><td class="src">-&gt; <a href="Distribution-Simple-Command.html#t:OptionField" title="Distribution.Simple.Command">OptionField</a> a</td><td class="doc empty">&nbsp;</td></tr></table></div><div class="doc"><p>Create an option taking several OptDescrs.
   You will have to give the flags and description individually to the
   OptDescr constructor.</p></div></div><a href="#g:8" id="g:8"><h2>Liftings &amp; Projections</h2></a><div class="top"><p class="src"><a id="v:liftOption" class="def">liftOption</a> :: (b -&gt; a) -&gt; (a -&gt; b -&gt; b) -&gt; <a href="Distribution-Simple-Command.html#t:OptionField" title="Distribution.Simple.Command">OptionField</a> a -&gt; <a href="Distribution-Simple-Command.html#t:OptionField" title="Distribution.Simple.Command">OptionField</a> b <a href="#v:liftOption" class="selflink">#</a></p></div><a href="#g:9" id="g:9"><h1>Option Descriptions</h1></a><div class="top"><p class="src"><span class="keyword">data</span> <a id="t:OptDescr" class="def">OptDescr</a> a <a href="#t:OptDescr" class="selflink">#</a></p><div class="doc"><p>An OptionField takes one or more OptDescrs, describing the command line
 interface for the field.</p></div><div class="subs constructors"><p class="caption">Constructors</p><table><tr><td class="src"><a id="v:ReqArg" class="def">ReqArg</a> <a href="Distribution-Simple-Command.html#t:Description" title="Distribution.Simple.Command">Description</a> <a href="Distribution-Simple-Command.html#t:OptFlags" title="Distribution.Simple.Command">OptFlags</a> <a href="Distribution-Simple-Command.html#t:ArgPlaceHolder" title="Distribution.Simple.Command">ArgPlaceHolder</a> (<a href="Distribution-ReadE.html#t:ReadE" title="Distribution.ReadE">ReadE</a> (a -&gt; a)) (a -&gt; [<a href="Distribution-Compat-Prelude-Internal.html#t:String" title="Distribution.Compat.Prelude.Internal">String</a>])</td><td class="doc empty">&nbsp;</td></tr><tr><td class="src"><a id="v:OptArg" class="def">OptArg</a> <a href="Distribution-Simple-Command.html#t:Description" title="Distribution.Simple.Command">Description</a> <a href="Distribution-Simple-Command.html#t:OptFlags" title="Distribution.Simple.Command">OptFlags</a> <a href="Distribution-Simple-Command.html#t:ArgPlaceHolder" title="Distribution.Simple.Command">ArgPlaceHolder</a> (<a href="Distribution-ReadE.html#t:ReadE" title="Distribution.ReadE">ReadE</a> (a -&gt; a)) (a -&gt; a) (a -&gt; [<a href="Distribution-Compat-Prelude-Internal.html#t:Maybe" title="Distribution.Compat.Prelude.Internal">Maybe</a> <a href="Distribution-Compat-Prelude-Internal.html#t:String" title="Distribution.Compat.Prelude.Internal">String</a>])</td><td class="doc empty">&nbsp;</td></tr><tr><td class="src"><a id="v:ChoiceOpt" class="def">ChoiceOpt</a> [(<a href="Distribution-Simple-Command.html#t:Description" title="Distribution.Simple.Command">Description</a>, <a href="Distribution-Simple-Command.html#t:OptFlags" title="Distribution.Simple.Command">OptFlags</a>, a -&gt; a, a -&gt; <a href="Distribution-Compat-Prelude-Internal.html#t:Bool" title="Distribution.Compat.Prelude.Internal">Bool</a>)]</td><td class="doc empty">&nbsp;</td></tr><tr><td class="src"><a id="v:BoolOpt" class="def">BoolOpt</a> <a href="Distribution-Simple-Command.html#t:Description" title="Distribution.Simple.Command">Description</a> <a href="Distribution-Simple-Command.html#t:OptFlags" title="Distribution.Simple.Command">OptFlags</a> <a href="Distribution-Simple-Command.html#t:OptFlags" title="Distribution.Simple.Command">OptFlags</a> (<a href="Distribution-Compat-Prelude-Internal.html#t:Bool" title="Distribution.Compat.Prelude.Internal">Bool</a> -&gt; a -&gt; a) (a -&gt; <a href="Distribution-Compat-Prelude-Internal.html#t:Maybe" title="Distribution.Compat.Prelude.Internal">Maybe</a> <a href="Distribution-Compat-Prelude-Internal.html#t:Bool" title="Distribution.Compat.Prelude.Internal">Bool</a>)</td><td class="doc empty">&nbsp;</td></tr></table></div></div><div class="top"><p class="src"><span class="keyword">type</span> <a id="t:Description" class="def">Description</a> = <a href="Distribution-Compat-Prelude-Internal.html#t:String" title="Distribution.Compat.Prelude.Internal">String</a> <a href="#t:Description" class="selflink">#</a></p></div><div class="top"><p class="src"><span class="keyword">type</span> <a id="t:SFlags" class="def">SFlags</a> = [<a href="Distribution-Compat-Prelude-Internal.html#t:Char" title="Distribution.Compat.Prelude.Internal">Char</a>] <a href="#t:SFlags" class="selflink">#</a></p><div class="doc"><p>Short command line option strings</p></div></div><div class="top"><p class="src"><span class="keyword">type</span> <a id="t:LFlags" class="def">LFlags</a> = [<a href="Distribution-Compat-Prelude-Internal.html#t:String" title="Distribution.Compat.Prelude.Internal">String</a>] <a href="#t:LFlags" class="selflink">#</a></p><div class="doc"><p>Long command line option strings</p></div></div><div class="top"><p class="src"><span class="keyword">type</span> <a id="t:OptFlags" class="def">OptFlags</a> = (<a href="Distribution-Simple-Command.html#t:SFlags" title="Distribution.Simple.Command">SFlags</a>, <a href="Distribution-Simple-Command.html#t:LFlags" title="Distribution.Simple.Command">LFlags</a>) <a href="#t:OptFlags" class="selflink">#</a></p></div><div class="top"><p class="src"><span class="keyword">type</span> <a id="t:ArgPlaceHolder" class="def">ArgPlaceHolder</a> = <a href="Distribution-Compat-Prelude-Internal.html#t:String" title="Distribution.Compat.Prelude.Internal">String</a> <a href="#t:ArgPlaceHolder" class="selflink">#</a></p></div><a href="#g:10" id="g:10"><h2>OptDescr <code>smart</code> constructors</h2></a><div class="top"><p class="src"><span class="keyword">type</span> <a id="t:MkOptDescr" class="def">MkOptDescr</a> get set a = <a href="Distribution-Simple-Command.html#t:SFlags" title="Distribution.Simple.Command">SFlags</a> -&gt; <a href="Distribution-Simple-Command.html#t:LFlags" title="Distribution.Simple.Command">LFlags</a> -&gt; <a href="Distribution-Simple-Command.html#t:Description" title="Distribution.Simple.Command">Description</a> -&gt; get -&gt; set -&gt; <a href="Distribution-Simple-Command.html#t:OptDescr" title="Distribution.Simple.Command">OptDescr</a> a <a href="#t:MkOptDescr" class="selflink">#</a></p></div><div class="top"><p class="src"><a id="v:reqArg" class="def">reqArg</a> :: <a href="Distribution-Compat-Semigroup.html#t:Monoid" title="Distribution.Compat.Semigroup">Monoid</a> b =&gt; <a href="Distribution-Simple-Command.html#t:ArgPlaceHolder" title="Distribution.Simple.Command">ArgPlaceHolder</a> -&gt; <a href="Distribution-ReadE.html#t:ReadE" title="Distribution.ReadE">ReadE</a> b -&gt; (b -&gt; [<a href="Distribution-Compat-Prelude-Internal.html#t:String" title="Distribution.Compat.Prelude.Internal">String</a>]) -&gt; <a href="Distribution-Simple-Command.html#t:MkOptDescr" title="Distribution.Simple.Command">MkOptDescr</a> (a -&gt; b) (b -&gt; a -&gt; a) a <a href="#v:reqArg" class="selflink">#</a></p><div class="doc"><p>Create a string-valued command line interface.</p></div></div><div class="top"><p class="src"><a id="v:reqArg-39-" class="def">reqArg'</a> :: <a href="Distribution-Compat-Semigroup.html#t:Monoid" title="Distribution.Compat.Semigroup">Monoid</a> b =&gt; <a href="Distribution-Simple-Command.html#t:ArgPlaceHolder" title="Distribution.Simple.Command">ArgPlaceHolder</a> -&gt; (<a href="Distribution-Compat-Prelude-Internal.html#t:String" title="Distribution.Compat.Prelude.Internal">String</a> -&gt; b) -&gt; (b -&gt; [<a href="Distribution-Compat-Prelude-Internal.html#t:String" title="Distribution.Compat.Prelude.Internal">String</a>]) -&gt; <a href="Distribution-Simple-Command.html#t:MkOptDescr" title="Distribution.Simple.Command">MkOptDescr</a> (a -&gt; b) (b -&gt; a -&gt; a) a <a href="#v:reqArg-39-" class="selflink">#</a></p><div class="doc"><p>(String -&gt; a) variant of &quot;reqArg&quot;</p></div></div><div class="top"><p class="src"><a id="v:optArg" class="def">optArg</a> :: <a href="Distribution-Compat-Semigroup.html#t:Monoid" title="Distribution.Compat.Semigroup">Monoid</a> b =&gt; <a href="Distribution-Simple-Command.html#t:ArgPlaceHolder" title="Distribution.Simple.Command">ArgPlaceHolder</a> -&gt; <a href="Distribution-ReadE.html#t:ReadE" title="Distribution.ReadE">ReadE</a> b -&gt; b -&gt; (b -&gt; [<a href="Distribution-Compat-Prelude-Internal.html#t:Maybe" title="Distribution.Compat.Prelude.Internal">Maybe</a> <a href="Distribution-Compat-Prelude-Internal.html#t:String" title="Distribution.Compat.Prelude.Internal">String</a>]) -&gt; <a href="Distribution-Simple-Command.html#t:MkOptDescr" title="Distribution.Simple.Command">MkOptDescr</a> (a -&gt; b) (b -&gt; a -&gt; a) a <a href="#v:optArg" class="selflink">#</a></p><div class="doc"><p>Create a string-valued command line interface with a default value.</p></div></div><div class="top"><p class="src"><a id="v:optArg-39-" class="def">optArg'</a> :: <a href="Distribution-Compat-Semigroup.html#t:Monoid" title="Distribution.Compat.Semigroup">Monoid</a> b =&gt; <a href="Distribution-Simple-Command.html#t:ArgPlaceHolder" title="Distribution.Simple.Command">ArgPlaceHolder</a> -&gt; (<a href="Distribution-Compat-Prelude-Internal.html#t:Maybe" title="Distribution.Compat.Prelude.Internal">Maybe</a> <a href="Distribution-Compat-Prelude-Internal.html#t:String" title="Distribution.Compat.Prelude.Internal">String</a> -&gt; b) -&gt; (b -&gt; [<a href="Distribution-Compat-Prelude-Internal.html#t:Maybe" title="Distribution.Compat.Prelude.Internal">Maybe</a> <a href="Distribution-Compat-Prelude-Internal.html#t:String" title="Distribution.Compat.Prelude.Internal">String</a>]) -&gt; <a href="Distribution-Simple-Command.html#t:MkOptDescr" title="Distribution.Simple.Command">MkOptDescr</a> (a -&gt; b) (b -&gt; a -&gt; a) a <a href="#v:optArg-39-" class="selflink">#</a></p><div class="doc"><p>(String -&gt; a) variant of &quot;optArg&quot;</p></div></div><div class="top"><p class="src"><a id="v:noArg" class="def">noArg</a> :: <a href="Distribution-Compat-Prelude-Internal.html#t:Eq" title="Distribution.Compat.Prelude.Internal">Eq</a> b =&gt; b -&gt; <a href="Distribution-Simple-Command.html#t:MkOptDescr" title="Distribution.Simple.Command">MkOptDescr</a> (a -&gt; b) (b -&gt; a -&gt; a) a <a href="#v:noArg" class="selflink">#</a></p></div><div class="top"><p class="src"><a id="v:boolOpt" class="def">boolOpt</a> :: (b -&gt; <a href="Distribution-Compat-Prelude-Internal.html#t:Maybe" title="Distribution.Compat.Prelude.Internal">Maybe</a> <a href="Distribution-Compat-Prelude-Internal.html#t:Bool" title="Distribution.Compat.Prelude.Internal">Bool</a>) -&gt; (<a href="Distribution-Compat-Prelude-Internal.html#t:Bool" title="Distribution.Compat.Prelude.Internal">Bool</a> -&gt; b) -&gt; <a href="Distribution-Simple-Command.html#t:SFlags" title="Distribution.Simple.Command">SFlags</a> -&gt; <a href="Distribution-Simple-Command.html#t:SFlags" title="Distribution.Simple.Command">SFlags</a> -&gt; <a href="Distribution-Simple-Command.html#t:MkOptDescr" title="Distribution.Simple.Command">MkOptDescr</a> (a -&gt; b) (b -&gt; a -&gt; a) a <a href="#v:boolOpt" class="selflink">#</a></p></div><div class="top"><p class="src"><a id="v:boolOpt-39-" class="def">boolOpt'</a> :: (b -&gt; <a href="Distribution-Compat-Prelude-Internal.html#t:Maybe" title="Distribution.Compat.Prelude.Internal">Maybe</a> <a href="Distribution-Compat-Prelude-Internal.html#t:Bool" title="Distribution.Compat.Prelude.Internal">Bool</a>) -&gt; (<a href="Distribution-Compat-Prelude-Internal.html#t:Bool" title="Distribution.Compat.Prelude.Internal">Bool</a> -&gt; b) -&gt; <a href="Distribution-Simple-Command.html#t:OptFlags" title="Distribution.Simple.Command">OptFlags</a> -&gt; <a href="Distribution-Simple-Command.html#t:OptFlags" title="Distribution.Simple.Command">OptFlags</a> -&gt; <a href="Distribution-Simple-Command.html#t:MkOptDescr" title="Distribution.Simple.Command">MkOptDescr</a> (a -&gt; b) (b -&gt; a -&gt; a) a <a href="#v:boolOpt-39-" class="selflink">#</a></p></div><div class="top"><p class="src"><a id="v:choiceOpt" class="def">choiceOpt</a> :: <a href="Distribution-Compat-Prelude-Internal.html#t:Eq" title="Distribution.Compat.Prelude.Internal">Eq</a> b =&gt; [(b, <a href="Distribution-Simple-Command.html#t:OptFlags" title="Distribution.Simple.Command">OptFlags</a>, <a href="Distribution-Simple-Command.html#t:Description" title="Distribution.Simple.Command">Description</a>)] -&gt; <a href="Distribution-Simple-Command.html#t:MkOptDescr" title="Distribution.Simple.Command">MkOptDescr</a> (a -&gt; b) (b -&gt; a -&gt; a) a <a href="#v:choiceOpt" class="selflink">#</a></p><div class="doc"><p>create a Choice option</p></div></div><div class="top"><p class="src"><a id="v:choiceOptFromEnum" class="def">choiceOptFromEnum</a> :: (<a href="Distribution-Compat-Prelude-Internal.html#t:Bounded" title="Distribution.Compat.Prelude.Internal">Bounded</a> b, <a href="Distribution-Compat-Prelude-Internal.html#t:Enum" title="Distribution.Compat.Prelude.Internal">Enum</a> b, <a href="Distribution-Compat-Prelude-Internal.html#t:Show" title="Distribution.Compat.Prelude.Internal">Show</a> b, <a href="Distribution-Compat-Prelude-Internal.html#t:Eq" title="Distribution.Compat.Prelude.Internal">Eq</a> b) =&gt; <a href="Distribution-Simple-Command.html#t:MkOptDescr" title="Distribution.Simple.Command">MkOptDescr</a> (a -&gt; b) (b -&gt; a -&gt; a) a <a href="#v:choiceOptFromEnum" class="selflink">#</a></p><div class="doc"><p>create a Choice option out of an enumeration type.
   As long flags, the Show output is used. As short flags, the first character
   which does not conflict with a previous one is used.</p></div></div></div></div><div id="footer"><p>Produced by <a href="http://www.haskell.org/haddock/">Haddock</a> version 2.22.0</p></div></body></html>