diff --git a/CHANGELOG.md b/CHANGELOG.md index 6f46dc9..9815c76 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,11 +1,35 @@ # Changelog +## 0.7.0 (2019-08-14) + +The repository has been moved to a [new location](https://github.com/luarocks/argparse). + +### New features + +* Added support for generating shell completion scripts for Bash, Zsh, and Fish + using the Parser methods `:get_bash_complete()`, `:get_zsh_complete()`, and + `:get_fish_complete()`. The Parser methods `:add_complete()` and + `:add_complete_command()` add a `--completion` option or `completion` command + to the parser. +* Added `:add_help_command()` method to Parser and Command objects. The help + command shows help for the specified subcommand. +* Added `choices` option and argument property for specifying a set of + acceptable values for the argument. +* Added `summary` command property for specifying the description shown in the + parent parser's help message. + +### Improvements + +* The location of the help flag in usage and help messages is now determined by + when it is added to the parser, rather than always being the last option. By + default it is now the first option. + ## 0.6.0 (2018-04-13) ### New features -* An array of functions can now be as the value of `converter` property, - so that multi-argumnet options can use different conversion rules +* An array of functions can now be used as the value of `converter` property, + so that multi-argument options can use different conversion rules for different arguments (#14). * Mutexes can now include positional arguments (#11). * Added `hidden` property for arguments, options and commands, diff --git a/README.md b/README.md index 1dae6aa..b5a7f32 100644 --- a/README.md +++ b/README.md @@ -5,7 +5,7 @@ Argparse is a feature-rich command line parser for Lua inspired by argparse for Python. -Argparse supports positional arguments, options, flags, optional arguments, subcommands and more. Argparse automatically generates usage, help and error messages. +Argparse supports positional arguments, options, flags, optional arguments, subcommands and more. Argparse automatically generates usage, help, and error messages, and can generate shell completion scripts. ## Contents diff --git a/argparse-scm-2.rockspec b/argparse-scm-2.rockspec index aa098e8..9a124a6 100644 --- a/argparse-scm-2.rockspec +++ b/argparse-scm-2.rockspec @@ -5,7 +5,7 @@ source = { } 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.", + detailed = "Argparse supports positional arguments, options, flags, optional arguments, subcommands and more. Argparse automatically generates usage, help, and error messages, and can generate shell completion scripts.", homepage = "https://github.com/luarocks/argparse", license = "MIT" } diff --git a/docsrc/conf.py b/docsrc/conf.py index 79baf72..521ac87 100644 --- a/docsrc/conf.py +++ b/docsrc/conf.py @@ -51,9 +51,9 @@ copyright = u'2013 - 2018, Peter Melnichenko' # built documents. # # The short X.Y version. -version = '0.6.0' +version = '0.7.0' # The full version, including alpha/beta/rc tags. -release = '0.6.0' +release = '0.7.0' # The language for content autogenerated by Sphinx. Refer to documentation # for a list of supported languages. diff --git a/src/argparse.lua b/src/argparse.lua index e48337a..dc6cdb0 100644 --- a/src/argparse.lua +++ b/src/argparse.lua @@ -2069,7 +2069,7 @@ end local argparse = {} -argparse.version = "0.6.0" +argparse.version = "0.7.0" setmetatable(argparse, {__call = function(_, ...) return Parser(default_cmdline[0]):add_help(true)(...)