Skip to content

Commit

Permalink
Preparing for 0.2.0 release
Browse files Browse the repository at this point in the history
  • Loading branch information
mpeterv committed Mar 9, 2014
1 parent b42960c commit 8584258
Show file tree
Hide file tree
Showing 3 changed files with 47 additions and 1 deletion.
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -105,7 +105,7 @@ $ luarocks install argparse

#### Problems with old luarocks versions

You may get an error like `Parse error processing dependency '30log >= 0.8'` if you use luarocks 2.1 or older. In this case, either upgrade to at least luarocks 2.1.1 or install [30log](http://yonaba.github.io/30log/) manually, then download the rockspec for argparse, remove the line `"30log >= 0.8"` and run
You may get an error like `Parse error processing dependency '30log >= 0.9.1'` if you use luarocks 2.1 or older. In this case, either upgrade to at least luarocks 2.1.1 or install [30log](http://yonaba.github.io/30log/) manually, then download the rockspec for argparse, remove the line `"30log >= 0.9.1"` and run

```bash
$ luarocks install /path/to/argparse/rockspec
Expand Down
23 changes: 23 additions & 0 deletions doc/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -55,6 +55,8 @@ <h2 id="project_tagline"></h2>
<li><a href="#setting-number-of-invocations">Setting number of invocations</a></li>
</ul>
</li>
<li><a href="#mutually-exclusive-groups">Mutually exclusive groups</a></li>

<li>
<a href="#commands">Commands</a>

Expand Down Expand Up @@ -408,6 +410,27 @@ <h3>
<pre><code>verbosity 2
</code></pre>

<h2>
<a name="mutually-exclusive-groups" class="anchor" href="#mutually-exclusive-groups"><span class="octicon octicon-link"></span></a>Mutually exclusive groups</h2>

<p>A group of options can be marked as mutually exclusive using <code>:mutex()</code> method of the Parser class. </p>

<div class="highlight highlight-lua"><pre><span class="n">parser</span><span class="p">:</span><span class="n">mutex</span><span class="p">(</span>
<span class="n">parser</span><span class="p">:</span><span class="n">flag</span> <span class="s2">"</span><span class="s">-q"</span> <span class="s2">"</span><span class="s">--quiet"</span><span class="p">,</span>
<span class="n">parser</span><span class="p">:</span><span class="n">flag</span> <span class="s2">"</span><span class="s">-v"</span> <span class="s2">"</span><span class="s">--verbose"</span>
<span class="p">)</span>
</pre></div>

<p>If more than one element of a mutually exclusive group is used, an error is raised. </p>

<div class="highlight highlight-bash"><pre><span class="nv">$ </span>lua script.lua -qv
</pre></div>

<pre><code>Usage: script.lua ([-q] | [-v]) [-h]

Error: option '-v' can not be used together with option '-q'
</code></pre>

<h2>
<a name="commands" class="anchor" href="#commands"><span class="octicon octicon-link"></span></a>Commands</h2>

Expand Down
23 changes: 23 additions & 0 deletions rockspecs/argparse-0.2.0-1.rockspec
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
package = "argparse"
version = "0.2.0-1"
source = {
url = "git://github.com/mpeterv/argparse.git",
tag = "0.2.0"
}
description = {
summary = "A feature-rich command-line argument parser",
detailed = "argparse supports positional arguments, options, flags, optional arguments, subcommands and more. argparse automatically generates usage, help and error messages. ",
homepage = "https://github.com/mpeterv/argparse",
license = "MIT/X11"
}
dependencies = {
"lua >= 5.1, < 5.3",
"30log >= 0.9.1"
}
build = {
type = "builtin",
modules = {
argparse = "src/argparse.lua"
},
copy_directories = {"doc", "spec"}
}

0 comments on commit 8584258

Please sign in to comment.