packages feed

cmdargs 0.10.7 → 0.10.8

raw patch · 15 files changed

+566/−464 lines, 15 files

Files

+ CHANGES.txt view
@@ -0,0 +1,119 @@+Changelog for CmdArgs++0.10.8+    #9, add --numeric-version flag+    Update the copyright year+    Change GetOpt.usageInfo to be more like GetOpt+0.10.7+    #1, fix timestamps in .tar.gz dist file+0.10.6+    #625, more documentation about args/argPos+    #626, ensure initial lists don't get reversed (fix after #610)+0.10.5+    #615, support lists inside a newtype+0.10.4+    #610, make sure it is O(n) to append arguments, not O(n^2)+0.10.3+    Append list items under an enum+    Support &= ignore on enum fields+0.10.2+    Relax upper bounds to be GHC 7.7 compatible+0.10.1+    #569, set the test program to off by default+	Complete revamp of cmdargs-browser, far better Javascript+    Add a missing case for Helper marshalling FlagNone+0.10+    Revert to 0.9.6, including modeExpandAt+0.9.7+    Revert to 0.9.5, to fix up PVP breakage+0.9.6+    #539, hopefully more fixes to compiling in profile mode+    #522, add modeExpandAt and noAtExpand annotation+    #522, don't @expand after --+0.9.5+    Don't specify TH extension unless quotation is true+0.9.4+    #539, specify the TH extension in the Cabal file+    Allow transformers 0.3.*+    Correct copyright in license and cabal file+0.9.3+    Add expandArgsAt and support for @ flag file directives+0.9.2+    Don't build the test program if quotation is turned off+0.9.1+    Improve the documentation for the Explicit module+    #433, propagate groupname on modes in the Implicit code+0.9+    #467, add completions for people running bash+    #334, add a Quote module, to write pure in the impure syntax+    #482, fix the sample in Explicit, don't use def+    #461, fix the translation for enum/enum_+    Make showHelp take an argument for the prefix bits+    Add Helper interface, and initial cmdargs-browser code+    Add splitArgs/joinArgs+0.8+    #450, redo the manual generator so Maker example is not cut off+    Support all the types in Data.Int/Data.Word+    Make modeArgs take a list of arguments as well+0.7+    No changes, just a version bump to allow requiring the GHC fix+0.6.10+    Change the annotate module to cope better with GHC's CSE+0.6.9+    #422, support newtype value as the underlying type+0.6.8+    Allow versionArgs [summary] to override --version+    Improve the documentation surrounding opt+    Add modeReform to Mode+    Add modeEmpty, to construct blank Mode values+    Improve the documentation surrounding pure annotations.+0.6.7+    #395, don't put two newlines after --help or --version+0.6.6+    #392, support helpArgs [groupname "something"]+0.6.5+    Don't fail with ambiguous enum if you exactly match a value+    Put errors on stderr+0.6.4+    Eliminate the filepath dependence+0.6.3+    Switch mtl for transformers+0.6.2+    Build on GHC 7.0 RC2, add an extra type signature+    Add verbosityArgs to customise the verbose/quiet flags+    Add helpArg/versionArg flags to customise those flags+    Support multiline summary using \n escape codes+0.6.1+    Build on GHC 6.10, don't rely on record name disambiguation+0.6+    Add ignore annotation for modes and flags+    #350, make top-level help appear properly+0.5+    #351, name/explicit attributes on mode were broken (regression)+0.4+    #342, display common fields only once+    Raise errors if annotations are placed in invalid places+    Rewrite the translation of annotation to explicit modes+    Treat anything after -- as an argument+    Add a pure annotation mechanism+    Introduce System.Console.CmdArgs.Annotate+0.3+    Add a documentation example for the Explicit mode+    Improve the purity and annotations a bit, try disabling CSE+    Change the help format+    Rename groupHiden to groupHidden, patch from Matthew Cox+    Bug, missing fields and explicit enums didn't work together+0.2+    #252, add support for grouped flags/modes+    #333, support missing fields+    Add support for reading tuple values (including nested)+    #292, add support for automatic enumerations+    #221, make argpos work with non-string fields+    #222, support opt and args together+    #230, different modes can share short flags+    #295, make verbosity flags explicit+    #231, add support for Maybe+    #256, add --option=false support+    Complete rewrite to introduce Explicit module+0.1.1+    Start of changelog
LICENSE view
@@ -1,4 +1,4 @@-Copyright Neil Mitchell 2009-2013.+Copyright Neil Mitchell 2009-2014. All rights reserved.  Redistribution and use in source and binary forms, with or without
+ README.md view
@@ -0,0 +1,405 @@+# CmdArgs: Easy Command Line Processing [![Build Status](https://travis-ci.org/ndmitchell/cmdargs.svg)](https://travis-ci.org/ndmitchell/cmdargs)++<p>+	CmdArgs is a Haskell library for defining command line parsers. The two features that make it a better choice than the standard <a href="http://haskell.org/ghc/docs/latest/html/libraries/base/System-Console-GetOpt.html">getopt library</a> are:+</p>+<ol>+	<li>It's very concise to use. The HLint command line handling is three times shorter with CmdArgs.</li>+	<li>It supports programs with multiple modes, such as <a href="http://darcs.net">darcs</a> or <a href="http://haskell.org/cabal/">Cabal</a>.</li>+</ol>+<p>+	A very simple example of a command line processor is:+</p>+<pre>+data Sample = Sample {hello :: String} deriving (Show, Data, Typeable)++sample = Sample{hello = def &amp;= help "World argument" &amp;= opt "world"}+         &amp;= summary "Sample v1"++main = print =&lt;&lt; cmdArgs sample+</pre>+<p>+	Despite being very concise, this processor is already fairly well featured:+</p>+<pre>+$ runhaskell Sample.hs --hello=world+Sample {hello = "world"}++$ runhaskell Sample.hs --help+Sample v1, (C) Neil Mitchell 2009++sample [FLAG]++  -? --help[=FORMAT]  Show usage information (optional format)+  -V --version        Show version information+  -v --verbose        Higher verbosity+  -q --quiet          Lower verbosity+  -h --hello=VALUE    World argument (default=world)+</pre>++<h2>User Manual</h2>++<p>+	The rest of this document explains how to write the "hello world" of command line processors, then how to extend it with features into a complex command line processor. Finally this document gives three samples, which the <tt>cmdargs</tt> program can run. The three samples are:+</p>+<ol>+    <li><tt>hlint</tt> - the <a href="http://community.haskell.org/~ndm/hlint/">HLint</a> program.</li>+    <li><tt>diffy</tt> - a program to compare the differences between directories.</li>+    <li><tt>maker</tt> - a make style program.</li>+</ol>+<p>+	For each example you are encouraged to look at it's source (see the <a href="http://community.haskell.org/~ndm/darcs/hlint">darcs repo</a>, or the bottom of this document) and run it (try <tt>cmdargs hlint --help</tt>). The HLint program is fairly standard in terms of it's argument processing, and previously used the <a href="http://haskell.org/ghc/docs/latest/html/libraries/base/System-Console-GetOpt.html">System.Console.GetOpt</a> library. Using GetOpt required 90 lines and a reasonable amount of duplication. Using CmdArgs the code requires 30 lines, and the logic is much simpler.+</p>+<h3>Acknowledgements</h3>+<p>+	Thanks to Kevin Quick for substantial patches, and additional code contributions from Sebastian Fischer and Daniel Schoepe.+</p>+++<h2>Hello World Example</h2>+<p>+	The following code defines a complete command line argument processor:+</p>++    {-# LANGUAGE DeriveDataTypeable #-}+    module Sample where+    import System.Console.CmdArgs+    +    data Sample = Sample {hello :: String}+                  deriving (Show, Data, Typeable)+    +    sample = Sample{hello = def}+    +    main = print =<< cmdArgs sample++<p>+	To use the CmdArgs library there are three steps:+</p>+<ol>+	<li>Define a record data type (<tt>Sample</tt>) that contains a field for each argument. This type needs to have instances for <tt>Show</tt>, <tt>Data</tt> and <tt>Typeable</tt>.</li>+	<li>Give a value of that type (<tt>sample</tt>) with default values (<tt>def</tt> is a default value of any type, but I could also have written <tt>""</tt>). This value is turned into a command line by calling the <tt>cmdArgs</tt> function.</li>+</ol>+<p>+	Now we have a reasonably functional command line argument processor. Some sample interactions are:+</p>+<pre>+$ runhaskell Sample.hs --hello=world+Sample {hello = "world"}++$ runhaskell Sample.hs --version+The sample program++$ runhaskell Sample.hs --help+The sample program++sample [OPTIONS]++  -? --help        Display help message+  -V --version     Print version information+  -h --hello=ITEM+</pre>+<p>+	CmdArgs uses defaults to automatically infer a command line parser for a value, and provides annotations to override any of the the defaults. CmdArgs automatically supports <tt>--help</tt> and <tt>--version</tt> flags, and optionally supports verbosity flags.+</p>++<h2>Specifying Attributes</h2>+<p>+	In order to control the behaviour we can add attributes. For example to add an attribute specifying the help text for the <tt>--hello</tt> argument we can write:+</p>+<pre>+sample = Sample{hello = def &= help "Who to say hello to"}+</pre>+<p>+	We can add additional attributes, for example to specify the type of the value expected by hello:+</p>+<pre>+sample = Sample {hello = def &= help "Who to say hello to" &= typ "WORLD"}+</pre>+<p>+	Now when running <tt>--help</tt> the final line is:+</p>+<pre>+  -h --hello=WORLD  Who to say hello to+</pre>+<p>+	There are many more attributes, detailed in the <a href="http://hackage.haskell.org/packages/archive/cmdargs/latest/doc/html/System-Console-CmdArgs.html#2">Haddock documentation</a>.+</p>+++<h2>Multiple Modes</h2>+<p>+	To specify a program with multiple modes, similar to <a href="http://darcs.net/">darcs</a>, we can supply a data type with multiple constructors, for example:+</p>++    +    data Sample = Hello {whom :: String}+                | Goodbye+                  deriving (Show, Data, Typeable)+    +    hello = Hello{whom = def}+    goodbye = Goodbye+    +    main = print =<< cmdArgs (modes [hello,goodbye])++<p>+	Compared to the first example, we now have multiple constructors, and a sample value for each constructor is passed to <tt>cmdArgs</tt>. Some sample interactions with this command line are:+</p>+<pre>+$ runhaskell Sample.hs hello --whom=world+Hello {whom = "world"}++$ runhaskell Sample.hs goodbye+Goodbye++$ runhaskell Sample.hs --help+The sample program++sample [OPTIONS]++ Common flags+  -? --help       Display help message+  -V --version    Print version information++sample hello [OPTIONS]++  -w --whom=ITEM++sample goodbye [OPTIONS]+</pre>+<p>+	As before, the behaviour can be customised using attributes.+</p>++<h2>Larger Examples</h2>++<p>+	For each of the following examples we first explain the purpose of the program, then give the source code, and finally the output of <tt>--help=HTML</tt>. The programs are intended to show sample uses of CmdArgs, and are available to experiment with through <tt>cmdargs <i>progname</i></tt>.+</p>++<h3>HLint</h3>++<p>+	The <a href="http://community.haskell.org/~ndm/hlint/">HLint</a> program analyses a list of files, using various options to control the analysis. The command line processing is simple, but a few interesting points are:+</p>+<ul>+	<li>The <tt>--report</tt> flag can be used to output a report in a standard location, but giving the flag a value changes where the file is output.</li>+	<li>The <tt>color</tt> field is assigned two flag aliases, <tt>--colour</tt> and <tt>-c</tt>. Assigning the <tt>-c</tt> short flag explicitly stops either of the CPP fields using it.</li>+	<li>The <tt>show_</tt> field would clash with <tt>show</tt> if given the expected name, but CmdArgs automatically strips the trailing underscore.</li>+	<li>The <tt>cpp_define</tt> field has an underscore in it's name, which is transformed into a hyphen for the flag name.</li>+</ul>++<!-- BEGIN code hlint -->+<pre>+{-# LANGUAGE DeriveDataTypeable #-}+module HLint where+import System.Console.CmdArgs++data HLint = HLint+    {report :: [FilePath]+    ,hint :: [FilePath]+    ,color :: Bool+    ,ignore_ :: [String]+    ,show_ :: Bool+    ,extension :: [String]+    ,language :: [String]+    ,utf8 :: Bool+    ,encoding :: String+    ,find :: [FilePath]+    ,test_ :: Bool+    ,datadir :: [FilePath]+    ,cpp_define :: [String]+    ,cpp_include :: [FilePath]+    ,files :: [FilePath]+    }+    deriving (Data,Typeable,Show,Eq)++hlint = HLint+    {report = def &= opt "report.html" &= typFile &= help "Generate a report in HTML"+    ,hint = def &= typFile &= help "Hint/ignore file to use"+    ,color = def &= name "c" &= name "colour" &= help "Color the output (requires ANSI terminal)"+    ,ignore_ = def &= typ "MESSAGE" &= help "Ignore a particular hint"+    ,show_ = def &= help "Show all ignored ideas"+    ,extension = def &= typ "EXT" &= help "File extensions to search (defaults to hs and lhs)"+    ,language = def &= name "X" &= typ "LANG" &= help "Language extension (Arrows, NoCPP)"+    ,utf8 = def &= help "Use UTF-8 text encoding"+    ,encoding = def &= typ "ENC" &= help "Choose the text encoding"+    ,find = def &= typFile &= help "Find hints in a Haskell file"+    ,test_ = def &= help "Run in test mode"+    ,datadir = def &= typDir &= help "Override the data directory"+    ,cpp_define = def &= typ "NAME[=VALUE]" &= help "CPP #define"+    ,cpp_include = def &= typDir &= help "CPP include path"+    ,files = def &= args &= typ "FILES/DIRS"+    } &=+    verbosity &=+    help "Suggest improvements to Haskell source code" &=+    summary "HLint v0.0.0, (C) Neil Mitchell" &=+    details ["Hlint gives hints on how to improve Haskell code",""+            ,"To check all Haskell files in 'src' and generate a report type:","  hlint src --report"]++mode = cmdArgsMode hlint+</pre>++    HLint v0.0.0, (C) Neil Mitchell+    +    hlint [OPTIONS] [FILES/DIRS]+    Suggest improvements to Haskell source code+    +    Common flags:+      -r --report[=FILE]	        Generate a report in HTML+      -h --hint=FILE	            Hint/ignore file to use+      -c --colour --color	        Color the output (requires ANSI terminal)+      -i --ignore=MESSAGE	        Ignore a particular hint+      -s --show                     Show all ignored ideas+         --extension=EXT            File extensions to search (defaults to hs and lhs)+      -X --language=LANG	        Language extension (Arrows, NoCPP)+      -u --utf8	                    Use UTF-8 text encoding+         --encoding=ENC	            Choose the text encoding+      -f --find=FILE	            Find hints in a Haskell file+      -t --test	                    Run in test mode+      -d --datadir=DIR	            Override the data directory+         --cpp-define=NAME[=VALUE]  CPP #define+         --cpp-include=DIR	        CPP include path+      -? --help	                    Display help message+      -V --version	                Print version information+      -v --verbose	                Loud verbosity+      -q --quiet	                Quiet verbosity+    +    Hlint gives hints on how to improve Haskell code+    +    To check all Haskell files in 'src' and generate a report type:+      hlint src --report+	++<h3>Diffy</h3>++<p>+	The Diffy sample is a based on the idea of creating directory listings and comparing them. The tool can operate in two separate modes, <tt>create</tt> or <tt>diff</tt>. This sample is fictional, but the ideas are drawn from a real program. A few notable features:+</p>+<ul>+	<li>There are multiple modes of execution, creating and diffing.</li>+	<li>The diff mode takes exactly two arguments, the old file and the new file.</li>+	<li>Default values are given for the <tt>out</tt> field, which are different in both modes.</li>+</ul>++<!-- BEGIN code diffy -->+<pre>+{-# LANGUAGE DeriveDataTypeable #-}+module Diffy where+import System.Console.CmdArgs++data Diffy = Create {src :: Maybe FilePath, out :: FilePath}+           | Diff {old :: FilePath, new :: FilePath, out :: FilePath}+             deriving (Data,Typeable,Show,Eq)++outFlags x = x &= help "Output file" &= typFile++create = Create+    {src = def &= help "Source directory" &= typDir+    ,out = outFlags "ls.txt"+    } &= help "Create a fingerprint"++diff = Diff+    {old = def &= typ "OLDFILE" &= argPos 0+    ,new = def &= typ "NEWFILE" &= argPos 1+    ,out = outFlags "diff.txt"+    } &= help "Perform a diff"++mode = cmdArgsMode $ modes [create,diff] &= help "Create and compare differences" &= program "diffy" &= summary "Diffy v1.0"+</pre>+<!-- END -->+<!-- BEGIN help diffy -->+	Diffy v1.0+	 +	diffy [COMMAND] ... [OPTIONS]+	  Create and compare differences+	 +	Common flags:+	  -o --out=FILE	 Output file+	  -? --help	     Display help message+	  -V --version	 Print version information+	 +	diffy create [OPTIONS]+	  Create a fingerprint+	 +	  -s  --src=DIR  Source directory+	 +	diffy diff [OPTIONS] OLDFILE NEWFILE+	  Perform a diff++<!-- END -->++<h3>Maker</h3>++<p>+	The Maker sample is based around a build system, where we can either build a project, clean the temporary files, or run a test. Some interesting features are:+</p>+<ul>+	<li>The build mode is the default, so <tt>maker</tt> on it's own will be interpretted as a build command.</li>+	<li>The build method is an enumeration.</li>+	<li>The <tt>threads</tt> field is in two of the constructors, but not all three. It is given the short flag <tt>-j</tt>, rather than the default <tt>-t</tt>.</li>+</ul>+++<!-- BEGIN code maker -->+<pre>+{-# LANGUAGE DeriveDataTypeable #-}+module Maker where+import System.Console.CmdArgs++data Method = Debug | Release | Profile+              deriving (Data,Typeable,Show,Eq)++data Maker+    = Wipe+    | Test {threads :: Int, extra :: [String]}+    | Build {threads :: Int, method :: Method, files :: [FilePath]}+      deriving (Data,Typeable,Show,Eq)++threadsMsg x = x &= help "Number of threads to use" &= name "j" &= typ "NUM"++wipe = Wipe &= help "Clean all build objects"++test_ = Test+    {threads = threadsMsg def+    ,extra = def &= typ "ANY" &= args+    } &= help "Run the test suite"++build = Build+    {threads = threadsMsg def+    ,method = enum+        [Release &= help "Release build"+        ,Debug &= help "Debug build"+        ,Profile &= help "Profile build"]+    ,files = def &= args+    } &= help "Build the project" &= auto++mode = cmdArgsMode $ modes [build,wipe,test_] &= help "Build helper program" &= program "maker" &= summary "Maker v1.0\nMake it"+</pre>+<!-- END -->+<!-- BEGIN help maker -->+    Maker v1.0+      Make it+     +    maker [COMMAND] ... [OPTIONS]+      Build helper program+     +    Common flags:+      -? --help     Display help message+      -V --version  Print version information+     +    maker [build] [OPTIONS] [ITEM]+      Build the project+     +      -j --threads=NUM  Number of threads to use+      -r --release      Release build+      -d --debug        Debug build+      -p --profile      Profile build+     +    maker wipe [OPTIONS]+      Clean all build objects+     +    maker test [OPTIONS] [ANY]+      Run the test suite+     +      -j --threads=NUM  Number of threads to use+<!-- END -->
System/Console/CmdArgs/Explicit.hs view
@@ -56,7 +56,7 @@     process, processArgs, processValue,     -- * Constructing command lines     module System.Console.CmdArgs.Explicit.Type,-    flagHelpSimple, flagHelpFormat, flagVersion, flagsVerbosity,+    flagHelpSimple, flagHelpFormat, flagVersion, flagNumericVersion, flagsVerbosity,     -- * Displaying help     module System.Console.CmdArgs.Explicit.Help,     -- * Utilities for working with command lines@@ -182,6 +182,10 @@ -- | Create a version flag triggered by @-V@/@--version@. flagVersion :: (a -> a) -> Flag a flagVersion f = flagNone ["version","V"] f "Print version information"++-- | Create a version flag triggered by @--numeric-version@.+flagNumericVersion :: (a -> a) -> Flag a+flagNumericVersion f = flagNone ["numeric-version"] f "Print just the version number"   -- | Create verbosity flags triggered by @-v@/@--verbose@ and
System/Console/CmdArgs/GetOpt.hs view
@@ -48,7 +48,7 @@ --   the header (first argument) and the options described by the  --   second argument. usageInfo :: String -> [OptDescr a] -> String-usageInfo desc flags = show $ convert desc flags+usageInfo desc flags = unlines $ desc : drop 2 (lines $ show $ convert "" flags)   -- | Process the command-line, and return the list of values that matched
System/Console/CmdArgs/Helper.hs view
@@ -172,8 +172,8 @@             deriving (Show,Read)  newtype NoShow a = NoShow a-instance Show (NoShow a) where -- deliberately leave the methods unimplemented-instance Read (NoShow a) where -- deliberately leave the methods unimplemented+instance Show (NoShow a) where showsPrec = error "Cannot show value of type NoShow"+instance Read (NoShow a) where readsPrec = error "Cannot read value of type NoShow"   transformM, descendM :: Monad m => (Pack -> m Pack) -> Pack -> m Pack
System/Console/CmdArgs/Implicit/Global.hs view
@@ -165,6 +165,8 @@           wrap x = def{flagFlag=x, flagExplicit=True, flagGroup=grp}           flags = changeBuiltin_ (progHelpArg p) (wrap $ flagHelpFormat $ error "flagHelpFormat undefined") ++                   changeBuiltin_ (progVersionArg p) (wrap $ flagVersion vers) +++                  concat [changeBuiltin_ (progVersionArg p) (wrap $ flagNumericVersion $ \x -> x{cmdArgsVersion = Just $ unlines v})+                        | Just v <- [progNumericVersionOutput p]] ++                   changeBuiltin_ (fst $ progVerbosityArgs p) (wrap loud) ++                   changeBuiltin_ (snd $ progVerbosityArgs p) (wrap quiet)           [loud,quiet] = flagsVerbosity verb
System/Console/CmdArgs/Implicit/Local.hs view
@@ -6,7 +6,7 @@ module System.Console.CmdArgs.Implicit.Local(     local, err,     Prog_(..), Builtin_(..), Mode_(..), Flag_(..), Fixup(..), isFlag_,-    progHelpOutput, progVersionOutput+    progHelpOutput, progVersionOutput, progNumericVersionOutput     ) where  import System.Console.CmdArgs.Implicit.Ann@@ -21,6 +21,7 @@ import Data.Char import Data.Generics.Any import Data.Maybe+import Data.List   data Prog_ = Prog_@@ -41,6 +42,14 @@  progHelpOutput = progOutput progHelpArg progVersionOutput = progOutput progVersionArg+progNumericVersionOutput x = fmap return $ parseVersion =<< listToMaybe (progVersionOutput x)++-- | Find numbers starting after space/comma, v+parseVersion :: String -> Maybe String+parseVersion xs = listToMaybe+    [y | x <- words $ map (\x -> if x `elem` ",;" then ' ' else x) xs+       , let y = fromMaybe x $ stripPrefix "v" x+       , length (takeWhile isDigit y) >= 1]   data Builtin_ = Builtin_
System/Console/CmdArgs/Implicit/UI.hs view
@@ -129,7 +129,8 @@ -- | Modes: \"My program name\/version\/copyright is ...\" -- --   One line summary of the entire program, the first line of---   @--help@ and the only line of @--version@.+--   @--help@ and the only line of @--version@. If the string contains a+--   version number component will also provide @--numeric-version@. -- -- > Sample{..} &= summary "CmdArgs v0.0, (C) Neil Mitchell 1981" summary :: String -> Ann
System/Console/CmdArgs/Test/Implicit/Diffy.hs view
@@ -54,6 +54,7 @@     isHelp ["diff","--help"] []     isHelpNot ["--help"] ["diffy"]     isVersion ["--version"] "Diffy v1.0"+    isVersion ["--numeric-version"] "1.0"     ["create"] === create     fails ["create","file1"]     fails ["create","--quiet"]@@ -66,7 +67,7 @@     ["diff","foo1","foo2"] === diff{old="foo1",new="foo2"}     fails ["diff","foo1"]     fails ["diff","foo1","foo2","foo3"]-    completion [] (0,0) [CompleteValue "create",CompleteValue "diff",CompleteValue "--out",CompleteValue "--help",CompleteValue "--version"]+    completion [] (0,0) [CompleteValue "create",CompleteValue "diff",CompleteValue "--out",CompleteValue "--help",CompleteValue "--version",CompleteValue "--numeric-version"]     completion ["d"] (0,1) [CompleteValue "diff"]     completion ["dd"] (0,2) [] 
System/Console/CmdArgs/Test/Implicit/HLint.hs view
@@ -61,6 +61,9 @@     isVerbosity [] Normal     isHelp ["-?"] ["HLint v0.0.0, (C) Neil Mitchell"]     isHelp ["--help"] ["  hlint src --report"]+    isVersion ["--version"] "HLint v0.0.0, (C) Neil Mitchell"+    isVersion ["-V"] "HLint v0.0.0, (C) Neil Mitchell"+    isVersion ["--numeric-version"] "0.0.0"     ["--colo"] === hlint{color=True}     ["--colour","--colour=false"] === hlint     ["--colour=true"] === hlint{color=True}
System/Console/CmdArgs/Test/Implicit/Tests.hs view
@@ -248,6 +248,7 @@     ["test13c","--foo13=13"] === Test13C 13     isHelp ["--help"] ["Help text here"]     isVersion ["--version"] "Version text here"+    fails ["--numeric-version"]  -- check a list becomes modes not an enum data Test14 = Test14A | Test14B | Test14C deriving (Eq,Show,Data,Typeable)@@ -292,11 +293,12 @@  data Test16 = Test16 {test16a :: MyInt, test16b :: [MyInt]} deriving (Eq,Show,Data,Typeable) -mode16 = cmdArgsMode $ Test16 (MyInt 12) []+mode16 = cmdArgsMode $ Test16 (MyInt 12) [] &= summary "The Glorious Glasgow Haskell Compilation System, version 7.6.3"  test16 = do     let Tester{..} = tester "Test16" mode16     [] === Test16 (MyInt 12) []+    isVersion ["--numeric-version"] "7.6.3"     fails ["--test16a"]     ["--test16a=5"] === Test16 (MyInt 5) []     ["--test16b=5","--test16b=82"] === Test16 (MyInt 12) [MyInt 5, MyInt 82]@@ -305,13 +307,14 @@ -- not actually checked because this path doesn't go through processArgs data Test17 = Test17 {test17_ :: [String]} deriving (Eq,Show,Data,Typeable) -mode17 = cmdArgsMode $ Test17 ([] &= args) &= noAtExpand+mode17 = cmdArgsMode $ Test17 ([] &= args) &= noAtExpand &= summary "bzip2 3.5-windows version"  test17 = do     let Tester{..} = tester "Test17" mode17     [] === Test17 []     ["test","of","this"] === Test17 ["test","of","this"]     ["test","--","@foo"] === Test17 ["test","@foo"]+    isVersion ["--numeric-version"] "3.5-windows"   data Debuggable = This | That deriving (Eq,Show,Data,Typeable)
System/Console/CmdArgs/Test/Implicit/Util.hs view
@@ -82,8 +82,9 @@             _ -> failed "Failed on isHelpNot" args []          isVersion args want = f args $ \x -> case x of-            Right x | Just got <- cmdArgsVersion x, match [want] (lines got) -> success-            _ -> failed "Failed on isVersion" args [("Want",want)]+            Right x | Just got <- cmdArgsVersion x, (want ++ "\n") == got -> success+            _ -> failed "Failed on isVersion" args $+                ("Want",want) : [("Got",got) | Right x <- [x], Just got <- [cmdArgsVersion x]]          isVerbosity args v = f args $ \x -> case x of             Right x | fromMaybe Normal (cmdArgsVerbosity x) == v -> success
cmdargs.cabal view
@@ -1,13 +1,13 @@ cabal-version:      >= 1.6 build-type:         Simple name:               cmdargs-version:            0.10.7+version:            0.10.8 license:            BSD3 license-file:       LICENSE category:           Console author:             Neil Mitchell <ndmitchell@gmail.com> maintainer:         Neil Mitchell <ndmitchell@gmail.com>-copyright:          Neil Mitchell 2009-2013+copyright:          Neil Mitchell 2009-2014 synopsis:           Command line argument processing description:     This library provides an easy way to define command line parsers. Most users@@ -28,10 +28,12 @@     .     For a general reference on what command line flags are commonly used,     see <http://www.faqs.org/docs/artu/ch10s05.html>.+bug-reports:        https://github.com/ndmitchell/cmdargs/issues homepage:           http://community.haskell.org/~ndm/cmdargs/-tested-with:        GHC==7.6.3, GHC==7.4.2, GHC==7.2.2 extra-source-files:-    cmdargs.htm+    README.md+    CHANGES.txt+tested-with:        GHC==7.8.2, GHC==7.6.3, GHC==7.4.2, GHC==7.2.2  source-repository head     type:     git
− cmdargs.htm
@@ -1,448 +0,0 @@-<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN"-        "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">-<html>-    <head>-        <meta http-equiv="Content-Type" content="text/html;charset=utf-8" />-        <title>CmdArgs: Easy Command Line Processing</title>-        <style type="text/css">-pre, .cmdargs {-    border: 2px solid gray;-    padding: 1px;-    padding-left: 5px;-    margin-left: 10px;-    background-color: #eee;-}--pre.define {-    background-color: #ffb;-    border-color: #cc0;-}--body {-    font-family: sans-serif;-}--h1, h2, h3 {-    font-family: serif;-}--h1 {-    color: rgb(23,54,93);-    border-bottom: 1px solid rgb(79,129,189);-    padding-bottom: 2px;-    font-variant: small-caps;-    text-align: center;-}--a {-    color: rgb(54,95,145);-}--h2 {-    color: rgb(54,95,145);-}--h3 {-    color: rgb(79,129,189);-}--p.rule {-    background-color: #ffb;-    padding: 3px;-    margin-left: 50px;-    margin-right: 50px;-}---.cmdargs {-	display: block;-	font-family: monospace;-}-.cmdargs td {-	padding: 0px;-	margin: 0px;-}-        </style>-    </head>-    <body>--<h1>CmdArgs: Easy Command Line Processing</h1>--<p style="text-align:right;margin-bottom:25px;">-    by <a href="http://community.haskell.org/~ndm/">Neil Mitchell</a>-</p>--<p>-    <a href="http://community.haskell.org/~ndm/cmdargs/">CmdArgs</a> is a library for defining and parsing command lines. The focus of CmdArgs is allowing the concise definition of fully-featured command line argument processors, in a mainly declarative manner (i.e. little coding needed). CmdArgs also supports multiple mode programs, for example as used in <a href="http://darcs.net/">darcs</a> and <a href="http://haskell.org/cabal/">Cabal</a>.-</p><p>-	This document explains how to write the "hello world" of command line processors, then how to extend it with features into a complex command line processor. Finally this document gives three samples, which the <tt>cmdargs</tt> program can run. The three samples are:-</p>-<ol>-    <li><tt>hlint</tt> - the <a href="http://community.haskell.org/~ndm/hlint/">HLint</a> program.</li>-    <li><tt>diffy</tt> - a program to compare the differences between directories.</li>-    <li><tt>maker</tt> - a make style program.</li>-</ol>-<p>-	For each example you are encouraged to look at it's source (see the <a href="http://community.haskell.org/~ndm/darcs/hlint">darcs repo</a>, or the bottom of this document) and run it (try <tt>cmdargs hlint --help</tt>). The HLint program is fairly standard in terms of it's argument processing, and previously used the <a href="http://haskell.org/ghc/docs/latest/html/libraries/base/System-Console-GetOpt.html">System.Console.GetOpt</a> library. Using GetOpt required 90 lines and a reasonable amount of duplication. Using CmdArgs the code requires 30 lines, and the logic is much simpler.-</p>-<h3>Acknowledgements</h3>-<p>-	Thanks to Kevin Quick for substantial patches, and additional code contributions from Sebastian Fischer and Daniel Schoepe.-</p>---<h2>Hello World Example</h2>-<p>-	The following code defines a complete command line argument processor:-</p>-<pre>-{-# LANGUAGE DeriveDataTypeable #-}-module Sample where-import System.Console.CmdArgs--data Sample = Sample {hello :: String}-              deriving (Show, Data, Typeable)--sample = Sample{hello = def}--main = print =<< cmdArgs sample-</pre>-<p>-	To use the CmdArgs library there are three steps:-</p>-<ol>-	<li>Define a record data type (<tt>Sample</tt>) that contains a field for each argument. This type needs to have instances for <tt>Show</tt>, <tt>Data</tt> and <tt>Typeable</tt>.</li>-	<li>Give a value of that type (<tt>sample</tt>) with default values (<tt>def</tt> is a default value of any type, but I could also have written <tt>""</tt>). This value is turned into a command line by calling the <tt>cmdArgs</tt> function.</li>-</ol>-<p>-	Now we have a reasonably functional command line argument processor. Some sample interactions are:-</p>-<pre>-$ runhaskell Sample.hs --hello=world-Sample {hello = "world"}--$ runhaskell Sample.hs --version-The sample program--$ runhaskell Sample.hs --help-The sample program--sample [OPTIONS]--  -? --help        Display help message-  -V --version     Print version information-  -h --hello=ITEM-</pre>-<p>-	CmdArgs uses defaults to automatically infer a command line parser for a value, and provides annotations to override any of the the defaults. CmdArgs automatically supports <tt>--help</tt> and <tt>--version</tt> flags, and optionally supports verbosity flags.-</p>--<h2>Specifying Attributes</h2>-<p>-	In order to control the behaviour we can add attributes. For example to add an attribute specifying the help text for the <tt>--hello</tt> argument we can write:-</p>-<pre>-sample = Sample{hello = def &= help "Who to say hello to"}-</pre>-<p>-	We can add additional attributes, for example to specify the type of the value expected by hello:-</p>-<pre>-sample = Sample {hello = def &= help "Who to say hello to" &= typ "WORLD"}-</pre>-<p>-	Now when running <tt>--help</tt> the final line is:-</p>-<pre>-  -h --hello=WORLD  Who to say hello to-</pre>-<p>-	There are many more attributes, detailed in the <a href="http://hackage.haskell.org/packages/archive/cmdargs/latest/doc/html/System-Console-CmdArgs.html#2">Haddock documentation</a>.-</p>---<h2>Multiple Modes</h2>-<p>-	To specify a program with multiple modes, similar to <a href="http://darcs.net/">darcs</a>, we can supply a data type with multiple constructors, for example:-</p>-<pre>-data Sample = Hello {whom :: String}-            | Goodbye-              deriving (Show, Data, Typeable)--hello = Hello{whom = def}-goodbye = Goodbye--main = print =<< cmdArgs (modes [hello,goodbye])-</pre>-<p>-	Compared to the first example, we now have multiple constructors, and a sample value for each constructor is passed to <tt>cmdArgs</tt>. Some sample interactions with this command line are:-</p>-<pre>-$ runhaskell Sample.hs hello --whom=world-Hello {whom = "world"}--$ runhaskell Sample.hs goodbye-Goodbye--$ runhaskell Sample.hs --help-The sample program--sample [OPTIONS]-- Common flags-  -? --help       Display help message-  -V --version    Print version information--sample hello [OPTIONS]--  -w --whom=ITEM--sample goodbye [OPTIONS]-</pre>-<p>-	As before, the behaviour can be customised using attributes.-</p>--<h2>Larger Examples</h2>--<p>-	For each of the following examples we first explain the purpose of the program, then give the source code, and finally the output of <tt>--help=HTML</tt>. The programs are intended to show sample uses of CmdArgs, and are available to experiment with through <tt>cmdargs <i>progname</i></tt>.-</p>--<h3>HLint</h3>--<p>-	The <a href="http://community.haskell.org/~ndm/hlint/">HLint</a> program analyses a list of files, using various options to control the analysis. The command line processing is simple, but a few interesting points are:-</p>-<ul>-	<li>The <tt>--report</tt> flag can be used to output a report in a standard location, but giving the flag a value changes where the file is output.</li>-	<li>The <tt>color</tt> field is assigned two flag aliases, <tt>--colour</tt> and <tt>-c</tt>. Assigning the <tt>-c</tt> short flag explicitly stops either of the CPP fields using it.</li>-	<li>The <tt>show_</tt> field would clash with <tt>show</tt> if given the expected name, but CmdArgs automatically strips the trailing underscore.</li>-	<li>The <tt>cpp_define</tt> field has an underscore in it's name, which is transformed into a hyphen for the flag name.</li>-</ul>--<!-- BEGIN code hlint -->-<pre>-{-# LANGUAGE DeriveDataTypeable #-}-module HLint where-import System.Console.CmdArgs--data HLint = HLint-    {report :: [FilePath]-    ,hint :: [FilePath]-    ,color :: Bool-    ,ignore_ :: [String]-    ,show_ :: Bool-    ,extension :: [String]-    ,language :: [String]-    ,utf8 :: Bool-    ,encoding :: String-    ,find :: [FilePath]-    ,test_ :: Bool-    ,datadir :: [FilePath]-    ,cpp_define :: [String]-    ,cpp_include :: [FilePath]-    ,files :: [FilePath]-    }-    deriving (Data,Typeable,Show,Eq)--hlint = HLint-    {report = def &= opt "report.html" &= typFile &= help "Generate a report in HTML"-    ,hint = def &= typFile &= help "Hint/ignore file to use"-    ,color = def &= name "c" &= name "colour" &= help "Color the output (requires ANSI terminal)"-    ,ignore_ = def &= typ "MESSAGE" &= help "Ignore a particular hint"-    ,show_ = def &= help "Show all ignored ideas"-    ,extension = def &= typ "EXT" &= help "File extensions to search (defaults to hs and lhs)"-    ,language = def &= name "X" &= typ "LANG" &= help "Language extension (Arrows, NoCPP)"-    ,utf8 = def &= help "Use UTF-8 text encoding"-    ,encoding = def &= typ "ENC" &= help "Choose the text encoding"-    ,find = def &= typFile &= help "Find hints in a Haskell file"-    ,test_ = def &= help "Run in test mode"-    ,datadir = def &= typDir &= help "Override the data directory"-    ,cpp_define = def &= typ "NAME[=VALUE]" &= help "CPP #define"-    ,cpp_include = def &= typDir &= help "CPP include path"-    ,files = def &= args &= typ "FILES/DIRS"-    } &=-    verbosity &=-    help "Suggest improvements to Haskell source code" &=-    summary "HLint v0.0.0, (C) Neil Mitchell" &=-    details ["Hlint gives hints on how to improve Haskell code",""-            ,"To check all Haskell files in 'src' and generate a report type:","  hlint src --report"]--mode = cmdArgsMode hlint-</pre>-<!-- END -->-<!-- BEGIN help hlint -->-<table class='cmdargs'>-<tr><td colspan='3'>HLint v0.0.0, (C) Neil Mitchell</td></tr>-<tr><td colspan='3'>&nbsp;</tr>-<tr><td colspan='3'>hlint [OPTIONS] [FILES/DIRS]</td></tr>-<tr><td colspan='3' style='padding-left:2ex;'>Suggest improvements to Haskell source code</td></tr>-<tr><td colspan='3'>&nbsp;</tr>-<tr><td colspan='3'>Common flags:</td></tr>-<tr><td style='padding-left:2ex;'>-r</td><td style='padding-left:1ex;'>--report[=FILE]</td><td style='padding-left:2ex;'>Generate a report in HTML</td></tr>-<tr><td style='padding-left:2ex;'>-h</td><td style='padding-left:1ex;'>--hint=FILE</td><td style='padding-left:2ex;'>Hint/ignore file to use</td></tr>-<tr><td style='padding-left:2ex;'>-c</td><td style='padding-left:1ex;'>--colour --color</td><td style='padding-left:2ex;'>Color the output (requires ANSI terminal)</td></tr>-<tr><td style='padding-left:2ex;'>-i</td><td style='padding-left:1ex;'>--ignore=MESSAGE</td><td style='padding-left:2ex;'>Ignore a particular hint</td></tr>-<tr><td style='padding-left:2ex;'>-s</td><td style='padding-left:1ex;'>--show</td><td style='padding-left:2ex;'>Show all ignored ideas</td></tr>-<tr><td style='padding-left:2ex;'>&nbsp;<td style='padding-left:1ex;'>--extension=EXT</td><td style='padding-left:2ex;'>File extensions to search (defaults to hs and lhs)</td></tr>-<tr><td style='padding-left:2ex;'>-X</td><td style='padding-left:1ex;'>--language=LANG</td><td style='padding-left:2ex;'>Language extension (Arrows, NoCPP)</td></tr>-<tr><td style='padding-left:2ex;'>-u</td><td style='padding-left:1ex;'>--utf8</td><td style='padding-left:2ex;'>Use UTF-8 text encoding</td></tr>-<tr><td style='padding-left:2ex;'>&nbsp;<td style='padding-left:1ex;'>--encoding=ENC</td><td style='padding-left:2ex;'>Choose the text encoding</td></tr>-<tr><td style='padding-left:2ex;'>-f</td><td style='padding-left:1ex;'>--find=FILE</td><td style='padding-left:2ex;'>Find hints in a Haskell file</td></tr>-<tr><td style='padding-left:2ex;'>-t</td><td style='padding-left:1ex;'>--test</td><td style='padding-left:2ex;'>Run in test mode</td></tr>-<tr><td style='padding-left:2ex;'>-d</td><td style='padding-left:1ex;'>--datadir=DIR</td><td style='padding-left:2ex;'>Override the data directory</td></tr>-<tr><td style='padding-left:2ex;'>&nbsp;<td style='padding-left:1ex;'>--cpp-define=NAME[=VALUE]</td><td style='padding-left:2ex;'>CPP #define</td></tr>-<tr><td style='padding-left:2ex;'>&nbsp;<td style='padding-left:1ex;'>--cpp-include=DIR</td><td style='padding-left:2ex;'>CPP include path</td></tr>-<tr><td style='padding-left:2ex;'>-?</td><td style='padding-left:1ex;'>--help</td><td style='padding-left:2ex;'>Display help message</td></tr>-<tr><td style='padding-left:2ex;'>-V</td><td style='padding-left:1ex;'>--version</td><td style='padding-left:2ex;'>Print version information</td></tr>-<tr><td style='padding-left:2ex;'>-v</td><td style='padding-left:1ex;'>--verbose</td><td style='padding-left:2ex;'>Loud verbosity</td></tr>-<tr><td style='padding-left:2ex;'>-q</td><td style='padding-left:1ex;'>--quiet</td><td style='padding-left:2ex;'>Quiet verbosity</td></tr>-<tr><td colspan='3'>&nbsp;</tr>-<tr><td colspan='3'>Hlint gives hints on how to improve Haskell code</td></tr>-<tr><td colspan='3'>&nbsp;</tr>-<tr><td colspan='3'>To check all Haskell files in 'src' and generate a report type:</td></tr>-<tr><td colspan='3' style='padding-left:2ex;'>hlint src --report</td></tr>-</table>-<!-- END -->--<h3>Diffy</h3>--<p>-	The Diffy sample is a based on the idea of creating directory listings and comparing them. The tool can operate in two separate modes, <tt>create</tt> or <tt>diff</tt>. This sample is fictional, but the ideas are drawn from a real program. A few notable features:-</p>-<ul>-	<li>There are multiple modes of execution, creating and diffing.</li>-	<li>The diff mode takes exactly two arguments, the old file and the new file.</li>-	<li>Default values are given for the <tt>out</tt> field, which are different in both modes.</li>-</ul>--<!-- BEGIN code diffy -->-<pre>-{-# LANGUAGE DeriveDataTypeable #-}-module Diffy where-import System.Console.CmdArgs--data Diffy = Create {src :: Maybe FilePath, out :: FilePath}-           | Diff {old :: FilePath, new :: FilePath, out :: FilePath}-             deriving (Data,Typeable,Show,Eq)--outFlags x = x &= help "Output file" &= typFile--create = Create-    {src = def &= help "Source directory" &= typDir-    ,out = outFlags "ls.txt"-    } &= help "Create a fingerprint"--diff = Diff-    {old = def &= typ "OLDFILE" &= argPos 0-    ,new = def &= typ "NEWFILE" &= argPos 1-    ,out = outFlags "diff.txt"-    } &= help "Perform a diff"--mode = cmdArgsMode $ modes [create,diff] &= help "Create and compare differences" &= program "diffy" &= summary "Diffy v1.0"-</pre>-<!-- END -->-<!-- BEGIN help diffy -->-<table class='cmdargs'>-<tr><td colspan='3'>Diffy v1.0</td></tr>-<tr><td colspan='3'>&nbsp;</tr>-<tr><td colspan='3'>diffy [COMMAND] ... [OPTIONS]</td></tr>-<tr><td colspan='3' style='padding-left:2ex;'>Create and compare differences</td></tr>-<tr><td colspan='3'>&nbsp;</tr>-<tr><td colspan='3'>Common flags:</td></tr>-<tr><td style='padding-left:2ex;'>-o</td><td style='padding-left:1ex;'>--out=FILE</td><td style='padding-left:2ex;'>Output file</td></tr>-<tr><td style='padding-left:2ex;'>-?</td><td style='padding-left:1ex;'>--help</td><td style='padding-left:2ex;'>Display help message</td></tr>-<tr><td style='padding-left:2ex;'>-V</td><td style='padding-left:1ex;'>--version</td><td style='padding-left:2ex;'>Print version information</td></tr>-<tr><td colspan='3'>&nbsp;</tr>-<tr><td colspan='3'>diffy create [OPTIONS]</td></tr>-<tr><td colspan='3' style='padding-left:2ex;'>Create a fingerprint</td></tr>-<tr><td colspan='3'>&nbsp;</tr>-<tr><td style='padding-left:2ex;'>-s</td><td style='padding-left:1ex;'>--src=DIR</td><td style='padding-left:2ex;'>Source directory</td></tr>-<tr><td colspan='3'>&nbsp;</tr>-<tr><td colspan='3'>diffy diff [OPTIONS] OLDFILE NEWFILE</td></tr>-<tr><td colspan='3' style='padding-left:2ex;'>Perform a diff</td></tr>-</table>-<!-- END -->--<h3>Maker</h3>--<p>-	The Maker sample is based around a build system, where we can either build a project, clean the temporary files, or run a test. Some interesting features are:-</p>-<ul>-	<li>The build mode is the default, so <tt>maker</tt> on it's own will be interpretted as a build command.</li>-	<li>The build method is an enumeration.</li>-	<li>The <tt>threads</tt> field is in two of the constructors, but not all three. It is given the short flag <tt>-j</tt>, rather than the default <tt>-t</tt>.</li>-</ul>---<!-- BEGIN code maker -->-<pre>-{-# LANGUAGE DeriveDataTypeable #-}-module Maker where-import System.Console.CmdArgs--data Method = Debug | Release | Profile-              deriving (Data,Typeable,Show,Eq)--data Maker-    = Wipe-    | Test {threads :: Int, extra :: [String]}-    | Build {threads :: Int, method :: Method, files :: [FilePath]}-      deriving (Data,Typeable,Show,Eq)--threadsMsg x = x &= help "Number of threads to use" &= name "j" &= typ "NUM"--wipe = Wipe &= help "Clean all build objects"--test_ = Test-    {threads = threadsMsg def-    ,extra = def &= typ "ANY" &= args-    } &= help "Run the test suite"--build = Build-    {threads = threadsMsg def-    ,method = enum-        [Release &= help "Release build"-        ,Debug &= help "Debug build"-        ,Profile &= help "Profile build"]-    ,files = def &= args-    } &= help "Build the project" &= auto--mode = cmdArgsMode $ modes [build,wipe,test_] &= help "Build helper program" &= program "maker" &= summary "Maker v1.0\nMake it"-</pre>-<!-- END -->-<!-- BEGIN help maker -->-<table class='cmdargs'>-<tr><td colspan='3'>Maker v1.0</td></tr>-<tr><td colspan='3'>Make it</td></tr>-<tr><td colspan='3'>&nbsp;</tr>-<tr><td colspan='3'>maker [COMMAND] ... [OPTIONS] </td></tr>-<tr><td colspan='3' style='padding-left:2ex;'>Build helper program</td></tr>-<tr><td colspan='3'>&nbsp;</tr>-<tr><td colspan='3'>Common flags:</td></tr>-<tr><td style='padding-left:2ex;'>-?</td><td style='padding-left:1ex;'>--help</td><td style='padding-left:2ex;'>Display help message</td></tr>-<tr><td style='padding-left:2ex;'>-V</td><td style='padding-left:1ex;'>--version</td><td style='padding-left:2ex;'>Print version information</td></tr>-<tr><td colspan='3'>&nbsp;</tr>-<tr><td colspan='3'>maker [build] [OPTIONS] [ITEM]</td></tr>-<tr><td colspan='3' style='padding-left:2ex;'>Build the project</td></tr>-<tr><td colspan='3'>&nbsp;</tr>-<tr><td style='padding-left:2ex;'>-j</td><td style='padding-left:1ex;'>--threads=NUM</td><td style='padding-left:2ex;'>Number of threads to use</td></tr>-<tr><td style='padding-left:2ex;'>-r</td><td style='padding-left:1ex;'>--release</td><td style='padding-left:2ex;'>Release build</td></tr>-<tr><td style='padding-left:2ex;'>-d</td><td style='padding-left:1ex;'>--debug</td><td style='padding-left:2ex;'>Debug build</td></tr>-<tr><td style='padding-left:2ex;'>-p</td><td style='padding-left:1ex;'>--profile</td><td style='padding-left:2ex;'>Profile build</td></tr>-<tr><td colspan='3'>&nbsp;</tr>-<tr><td colspan='3'>maker wipe [OPTIONS]</td></tr>-<tr><td colspan='3' style='padding-left:2ex;'>Clean all build objects</td></tr>-<tr><td colspan='3'>&nbsp;</tr>-<tr><td colspan='3'>maker test [OPTIONS] [ANY]</td></tr>-<tr><td colspan='3' style='padding-left:2ex;'>Run the test suite</td></tr>-<tr><td colspan='3'>&nbsp;</tr>-<tr><td style='padding-left:2ex;'>-j</td><td style='padding-left:1ex;'>--threads=NUM</td><td style='padding-left:2ex;'>Number of threads to use</td></tr>-</table>-<!-- END -->--    </body>-</html>