diff --git a/README.md b/README.md index 73c8e7e..a7043bd 100644 --- a/README.md +++ b/README.md @@ -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 diff --git a/doc/index.html b/doc/index.html index e1d89a3..15e0b07 100644 --- a/doc/index.html +++ b/doc/index.html @@ -55,6 +55,8 @@

  • Setting number of invocations
  • +
  • Mutually exclusive groups
  • +
  • Commands @@ -408,6 +410,27 @@

    verbosity   2
     
    +

    +Mutually exclusive groups

    + +

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

    + +
    parser:mutex(
    +   parser:flag "-q" "--quiet",
    +   parser:flag "-v" "--verbose"
    +)
    +
    + +

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

    + +
    $ lua script.lua -qv
    +
    + +
    Usage: script.lua ([-q] | [-v]) [-h]
    +
    +Error: option '-v' can not be used together with option '-q'
    +
    +

    Commands

    diff --git a/rockspecs/argparse-0.2.0-1.rockspec b/rockspecs/argparse-0.2.0-1.rockspec new file mode 100644 index 0000000..1185036 --- /dev/null +++ b/rockspecs/argparse-0.2.0-1.rockspec @@ -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"} +}