mirror of
https://github.com/TangentFoxy/argparse.git
synced 2025-07-29 03:22:18 +00:00
Preparing for 0.2.0 release
This commit is contained in:
@@ -105,7 +105,7 @@ $ luarocks install argparse
|
|||||||
|
|
||||||
#### Problems with old luarocks versions
|
#### 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
|
```bash
|
||||||
$ luarocks install /path/to/argparse/rockspec
|
$ luarocks install /path/to/argparse/rockspec
|
||||||
|
@@ -55,6 +55,8 @@
|
|||||||
<li><a href="#setting-number-of-invocations">Setting number of invocations</a></li>
|
<li><a href="#setting-number-of-invocations">Setting number of invocations</a></li>
|
||||||
</ul>
|
</ul>
|
||||||
</li>
|
</li>
|
||||||
|
<li><a href="#mutually-exclusive-groups">Mutually exclusive groups</a></li>
|
||||||
|
|
||||||
<li>
|
<li>
|
||||||
<a href="#commands">Commands</a>
|
<a href="#commands">Commands</a>
|
||||||
|
|
||||||
@@ -408,6 +410,27 @@ optional {}
|
|||||||
<pre><code>verbosity 2
|
<pre><code>verbosity 2
|
||||||
</code></pre>
|
</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>
|
<h2>
|
||||||
<a name="commands" class="anchor" href="#commands"><span class="octicon octicon-link"></span></a>Commands</h2>
|
<a name="commands" class="anchor" href="#commands"><span class="octicon octicon-link"></span></a>Commands</h2>
|
||||||
|
|
||||||
|
23
rockspecs/argparse-0.2.0-1.rockspec
Normal file
23
rockspecs/argparse-0.2.0-1.rockspec
Normal file
@@ -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"}
|
||||||
|
}
|
Reference in New Issue
Block a user