<?xml version="1.0" encoding="UTF-8"?><feed xmlns="http://www.w3.org/2005/Atom"><title xmlns:ns="http://www.w3.org/2005/Atom" ns:type="text">Command-line argument parsing – Haskell – Aelve Guide</title><id>https://guide.aelve.com/haskell/feed/category/m931dr6y</id><updated>2016-04-15T13:06:39Z</updated><link xmlns:ns="http://www.w3.org/2005/Atom" ns:href="https://guide.aelve.com/haskell/feed/category/m931dr6y"/><entry><id>h1qpe66x</id><title xmlns:ns="http://www.w3.org/2005/Atom" ns:type="text">getArgs :: IO [String]</title><updated>2016-04-15T13:06:39Z</updated><content xmlns:ns="http://www.w3.org/2005/Atom" ns:type="html">&lt;h1&gt;  &lt;span class=&#34;item-name&#34;&gt;getArgs :: IO [String]&lt;/span&gt;

&lt;/h1&gt;&lt;h2&gt;Pros&lt;/h2&gt;&lt;ul&gt;&lt;p&gt;&lt;li&gt;Easy to use&lt;/li&gt;&lt;/p&gt;&lt;p&gt;&lt;li&gt;No additional libraries&lt;/li&gt;&lt;/p&gt;&lt;/ul&gt;&lt;h2&gt;Cons&lt;/h2&gt;&lt;ul&gt;&lt;p&gt;&lt;li&gt;No argument parsing&lt;/li&gt;&lt;/p&gt;&lt;p&gt;&lt;li&gt;Not declarative&lt;/li&gt;&lt;/p&gt;&lt;/ul&gt;</content><link xmlns:ns="http://www.w3.org/2005/Atom" ns:href="https://guide.aelve.com/haskell/command-line-argument-parsing-m931dr6y#item-h1qpe66x"/></entry><entry><id>d13yczyz</id><title xmlns:ns="http://www.w3.org/2005/Atom" ns:type="text">optparse-simple</title><updated>2016-04-15T13:04:48Z</updated><content xmlns:ns="http://www.w3.org/2005/Atom" ns:type="html">&lt;h1&gt;  &lt;span class=&#34;item-name&#34;&gt;optparse-simple&lt;/span&gt;

  
  (&lt;a href=&#34;https://hackage.haskell.org/package/optparse-simple&#34;&gt;Hackage&lt;/a&gt;)
&lt;/h1&gt;&lt;h2&gt;Pros&lt;/h2&gt;&lt;ul&gt;&lt;/ul&gt;&lt;h2&gt;Cons&lt;/h2&gt;&lt;ul&gt;&lt;/ul&gt;</content><link xmlns:ns="http://www.w3.org/2005/Atom" ns:href="https://guide.aelve.com/haskell/command-line-argument-parsing-m931dr6y#item-d13yczyz"/></entry><entry><id>b0tvar69</id><title xmlns:ns="http://www.w3.org/2005/Atom" ns:type="text">uu-options</title><updated>2016-04-15T13:02:37Z</updated><content xmlns:ns="http://www.w3.org/2005/Atom" ns:type="html">&lt;h1&gt;  &lt;span class=&#34;item-name&#34;&gt;uu-options&lt;/span&gt;

  
  (&lt;a href=&#34;https://hackage.haskell.org/package/uu-options&#34;&gt;Hackage&lt;/a&gt;)
&lt;/h1&gt;&lt;h2&gt;Pros&lt;/h2&gt;&lt;ul&gt;&lt;/ul&gt;&lt;h2&gt;Cons&lt;/h2&gt;&lt;ul&gt;&lt;/ul&gt;</content><link xmlns:ns="http://www.w3.org/2005/Atom" ns:href="https://guide.aelve.com/haskell/command-line-argument-parsing-m931dr6y#item-b0tvar69"/></entry><entry><id>i1u0ybkl</id><title xmlns:ns="http://www.w3.org/2005/Atom" ns:type="text">console-program</title><updated>2016-04-15T12:58:46Z</updated><content xmlns:ns="http://www.w3.org/2005/Atom" ns:type="html">&lt;h1&gt;  &lt;span class=&#34;item-name&#34;&gt;console-program&lt;/span&gt;

  
  (&lt;a href=&#34;https://hackage.haskell.org/package/console-program&#34;&gt;Hackage&lt;/a&gt;)
&lt;/h1&gt;&lt;h2&gt;Pros&lt;/h2&gt;&lt;ul&gt;&lt;/ul&gt;&lt;h2&gt;Cons&lt;/h2&gt;&lt;ul&gt;&lt;/ul&gt;</content><link xmlns:ns="http://www.w3.org/2005/Atom" ns:href="https://guide.aelve.com/haskell/command-line-argument-parsing-m931dr6y#item-i1u0ybkl"/></entry><entry><id>vk7t1j1v</id><title xmlns:ns="http://www.w3.org/2005/Atom" ns:type="text">hflags</title><updated>2016-04-15T12:57:20Z</updated><content xmlns:ns="http://www.w3.org/2005/Atom" ns:type="html">&lt;h1&gt;  &lt;span class=&#34;item-name&#34;&gt;hflags&lt;/span&gt;

  
  (&lt;a href=&#34;https://hackage.haskell.org/package/hflags&#34;&gt;Hackage&lt;/a&gt;)
&lt;/h1&gt;&lt;h2&gt;Pros&lt;/h2&gt;&lt;ul&gt;&lt;/ul&gt;&lt;h2&gt;Cons&lt;/h2&gt;&lt;ul&gt;&lt;/ul&gt;</content><link xmlns:ns="http://www.w3.org/2005/Atom" ns:href="https://guide.aelve.com/haskell/command-line-argument-parsing-m931dr6y#item-vk7t1j1v"/></entry><entry><id>rr6x9cwy</id><title xmlns:ns="http://www.w3.org/2005/Atom" ns:type="text">System.Console.GetOpt</title><updated>2016-04-15T12:45:55Z</updated><content xmlns:ns="http://www.w3.org/2005/Atom" ns:type="html">&lt;h1&gt;  &lt;a href=&#34;https://hackage.haskell.org/package/base/docs/System-Console-GetOpt.html&#34; class=&#34;item-name&#34;&gt;System.Console.GetOpt&lt;/a&gt;

&lt;/h1&gt;&lt;h2&gt;Pros&lt;/h2&gt;&lt;ul&gt;&lt;/ul&gt;&lt;h2&gt;Cons&lt;/h2&gt;&lt;ul&gt;&lt;/ul&gt;</content><link xmlns:ns="http://www.w3.org/2005/Atom" ns:href="https://guide.aelve.com/haskell/command-line-argument-parsing-m931dr6y#item-rr6x9cwy"/></entry><entry><id>ai5amw2w</id><title xmlns:ns="http://www.w3.org/2005/Atom" ns:type="text">multiarg</title><updated>2016-04-15T12:45:44Z</updated><content xmlns:ns="http://www.w3.org/2005/Atom" ns:type="html">&lt;h1&gt;  &lt;span class=&#34;item-name&#34;&gt;multiarg&lt;/span&gt;

  
  (&lt;a href=&#34;https://hackage.haskell.org/package/multiarg&#34;&gt;Hackage&lt;/a&gt;)
&lt;/h1&gt;&lt;h2&gt;Pros&lt;/h2&gt;&lt;ul&gt;&lt;/ul&gt;&lt;h2&gt;Cons&lt;/h2&gt;&lt;ul&gt;&lt;/ul&gt;</content><link xmlns:ns="http://www.w3.org/2005/Atom" ns:href="https://guide.aelve.com/haskell/command-line-argument-parsing-m931dr6y#item-ai5amw2w"/></entry><entry><id>u77ds55o</id><title xmlns:ns="http://www.w3.org/2005/Atom" ns:type="text">lambda-options</title><updated>2016-04-15T12:43:19Z</updated><content xmlns:ns="http://www.w3.org/2005/Atom" ns:type="html">&lt;h1&gt;  &lt;span class=&#34;item-name&#34;&gt;lambda-options&lt;/span&gt;

  
  (&lt;a href=&#34;https://hackage.haskell.org/package/lambda-options&#34;&gt;Hackage&lt;/a&gt;)
&lt;/h1&gt;&lt;p&gt;Define options and their argument parameters using lambda functions.&lt;/p&gt;
&lt;h2&gt;Pros&lt;/h2&gt;&lt;ul&gt;&lt;p&gt;&lt;li&gt;Declarative&lt;/li&gt;&lt;/p&gt;&lt;p&gt;&lt;li&gt;Option parameters are statically typed&lt;/li&gt;&lt;/p&gt;&lt;p&gt;&lt;li&gt;Support for custom types&lt;/li&gt;&lt;/p&gt;&lt;p&gt;&lt;li&gt;Safe Haskell&lt;/li&gt;&lt;/p&gt;&lt;/ul&gt;&lt;h2&gt;Cons&lt;/h2&gt;&lt;ul&gt;&lt;/ul&gt;</content><link xmlns:ns="http://www.w3.org/2005/Atom" ns:href="https://guide.aelve.com/haskell/command-line-argument-parsing-m931dr6y#item-u77ds55o"/></entry><entry><id>rjif5pdt</id><title xmlns:ns="http://www.w3.org/2005/Atom" ns:type="text">cmdargs</title><updated>2016-04-15T12:43:04Z</updated><content xmlns:ns="http://www.w3.org/2005/Atom" ns:type="html">&lt;h1&gt;  &lt;span class=&#34;item-name&#34;&gt;cmdargs&lt;/span&gt;

  
  (&lt;a href=&#34;https://hackage.haskell.org/package/cmdargs&#34;&gt;Hackage&lt;/a&gt;)
&lt;/h1&gt;&lt;h2&gt;Pros&lt;/h2&gt;&lt;ul&gt;&lt;/ul&gt;&lt;h2&gt;Cons&lt;/h2&gt;&lt;ul&gt;&lt;/ul&gt;</content><link xmlns:ns="http://www.w3.org/2005/Atom" ns:href="https://guide.aelve.com/haskell/command-line-argument-parsing-m931dr6y#item-rjif5pdt"/></entry><entry><id>fk8tlojq</id><title xmlns:ns="http://www.w3.org/2005/Atom" ns:type="text">docopt</title><updated>2016-04-15T12:43:00Z</updated><content xmlns:ns="http://www.w3.org/2005/Atom" ns:type="html">&lt;h1&gt;  &lt;span class=&#34;item-name&#34;&gt;docopt&lt;/span&gt;

  
  (&lt;a href=&#34;https://hackage.haskell.org/package/docopt&#34;&gt;Hackage&lt;/a&gt;)
&lt;/h1&gt;&lt;h2&gt;Pros&lt;/h2&gt;&lt;ul&gt;&lt;/ul&gt;&lt;h2&gt;Cons&lt;/h2&gt;&lt;ul&gt;&lt;/ul&gt;</content><link xmlns:ns="http://www.w3.org/2005/Atom" ns:href="https://guide.aelve.com/haskell/command-line-argument-parsing-m931dr6y#item-fk8tlojq"/></entry><entry><id>rl8pkan4</id><title xmlns:ns="http://www.w3.org/2005/Atom" ns:type="text">options</title><updated>2016-04-15T12:42:58Z</updated><content xmlns:ns="http://www.w3.org/2005/Atom" ns:type="html">&lt;h1&gt;  &lt;span class=&#34;item-name&#34;&gt;options&lt;/span&gt;

  
  (&lt;a href=&#34;https://hackage.haskell.org/package/options&#34;&gt;Hackage&lt;/a&gt;)
&lt;/h1&gt;&lt;h2&gt;Pros&lt;/h2&gt;&lt;ul&gt;&lt;/ul&gt;&lt;h2&gt;Cons&lt;/h2&gt;&lt;ul&gt;&lt;/ul&gt;</content><link xmlns:ns="http://www.w3.org/2005/Atom" ns:href="https://guide.aelve.com/haskell/command-line-argument-parsing-m931dr6y#item-rl8pkan4"/></entry><entry><id>g0r4lc9m</id><title xmlns:ns="http://www.w3.org/2005/Atom" ns:type="text">optparse-applicative</title><updated>2016-04-14T09:43:53Z</updated><content xmlns:ns="http://www.w3.org/2005/Atom" ns:type="html">&lt;h1&gt;  &lt;span class=&#34;item-name&#34;&gt;optparse-applicative&lt;/span&gt;

  
  (&lt;a href=&#34;https://hackage.haskell.org/package/optparse-applicative&#34;&gt;Hackage&lt;/a&gt;)
&lt;/h1&gt;&lt;h2&gt;Pros&lt;/h2&gt;&lt;ul&gt;&lt;p&gt;&lt;li&gt;A lot of examples&lt;/li&gt;&lt;/p&gt;&lt;p&gt;&lt;li&gt;Powerful, declarative argument parsing&lt;/li&gt;&lt;/p&gt;&lt;p&gt;&lt;li&gt;Generates usage messages for command line applications&lt;/li&gt;&lt;/p&gt;&lt;p&gt;&lt;li&gt;Uses known typeclasses, such as Applicative and Monoid&lt;/li&gt;&lt;/p&gt;&lt;p&gt;&lt;li&gt;Arguments are statically typed&lt;/li&gt;&lt;/p&gt;&lt;/ul&gt;&lt;h2&gt;Cons&lt;/h2&gt;&lt;ul&gt;&lt;p&gt;&lt;li&gt;Might be hard to write, but examples substitute that&lt;/li&gt;&lt;/p&gt;&lt;/ul&gt;&lt;h2&gt;Notes&lt;/h2&gt;&lt;h1&gt;&lt;span id=&#34;item-notes-g0r4lc9m-links&#34;&gt;&lt;/span&gt;Links&lt;/h1&gt;&lt;ul&gt;
&lt;li&gt;&lt;a href=&#34;https://gist.github.com/neongreen/a3c3ebc430c53ec7d0af1b67a2566fc2&#34;&gt;an example of parsing commands with subcommands, flags, and global flags&lt;/a&gt;&lt;/li&gt;
&lt;/ul&gt;
&lt;h1&gt;&lt;span id=&#34;item-notes-g0r4lc9m-imports&#34;&gt;&lt;/span&gt;Imports&lt;/h1&gt;&lt;p&gt;Most commonly used imports from the library&lt;/p&gt;
&lt;h1&gt;&lt;span id=&#34;item-notes-g0r4lc9m-usage&#34;&gt;&lt;/span&gt;Usage&lt;/h1&gt;&lt;p&gt;Some examples&lt;/p&gt;
&lt;h1&gt;&lt;span id=&#34;item-notes-g0r4lc9m-gotchas&#34;&gt;&lt;/span&gt;Gotchas&lt;/h1&gt;&lt;p&gt;Common mistakes and non-obvious things&lt;/p&gt;
</content><link xmlns:ns="http://www.w3.org/2005/Atom" ns:href="https://guide.aelve.com/haskell/command-line-argument-parsing-m931dr6y#item-g0r4lc9m"/></entry></feed>