diff --git a/ChangeLog b/ChangeLog index da75762..5da88ff 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,13 +1,17 @@ -2.8.0 (TBA) +2.8.0 (2019-01-26) ----------- New features: * Allow argbash and argbash-init to be run from symbolic links. * Allow scripts generated by argbash-init with complete separation (`-s -s`) to be run from a symbolic link. -* Double quotes in help messages are escaped (fixes #61). +* Implemented output to generate manpages using the `rst2man` utility (fixes #37). * Introduced the `ARG_VERSION_AUTO` macro. -* Enabled manpage output consumable by the `rst2man` utility. + +Bugfixes: + +* Double quotes in help messages are escaped (fixes #61). +* Fixed regression that allowed duplicate short options (fixes #58). 2.7.1 (2018-08-15) diff --git a/README.md b/README.md index ebbf5ff..111d25e 100644 --- a/README.md +++ b/README.md @@ -58,6 +58,7 @@ Following outputs are available: - POSIX scripts that use `getopts`, also tailor-made. - Bash completion. - [docopt](https://docopt.org)-compliant usage message. +- Manpage output using [rst2man](http://docutils.sourceforge.net/sandbox/manpage-writer/rst2man.txt). The utility has been inspired by Python's `argparse` and the `shflags` project. diff --git a/bin/argbash b/bin/argbash index 89bb506..3aafc21 100755 --- a/bin/argbash +++ b/bin/argbash @@ -23,7 +23,7 @@ # ARGBASH_GO() # needed because of Argbash --> m4_ignore([ -### START OF CODE GENERATED BY Argbash v2.7.1 one line above ### +### START OF CODE GENERATED BY Argbash v2.8.0 one line above ### # Argbash is a bash code generator used to get arguments parsing right. # Argbash is FREE SOFTWARE, see https://argbash.io for more info @@ -187,11 +187,11 @@ parse_commandline() exit 0 ;; -v|--version) - printf '%s %s\n\n%s\n' "argbash" "2.7.1" 'Argbash is an argument parser generator for Bash.' + printf '%s %s\n\n%s\n' "argbash" "2.8.0" 'Argbash is an argument parser generator for Bash.' exit 0 ;; -v*) - printf '%s %s\n\n%s\n' "argbash" "2.7.1" 'Argbash is an argument parser generator for Bash.' + printf '%s %s\n\n%s\n' "argbash" "2.8.0" 'Argbash is an argument parser generator for Bash.' exit 0 ;; *) diff --git a/bin/argbash-1to2 b/bin/argbash-1to2 index 45cfa1a..e27f859 100755 --- a/bin/argbash-1to2 +++ b/bin/argbash-1to2 @@ -3,7 +3,7 @@ # shellcheck disable=SC2016 # SC2016: Expressions don't expand in single quotes, use double quotes for that. -version=2.7.1 +version=2.8.0 # ARG_POSITIONAL_INF([input],[The input file to transform],[1]) # ARG_OPTIONAL_SINGLE([output],[o],[Name of the output file (pass '-' for stdout and empty string for the same as input file)],[""]) # ARG_VERSION([echo "argbash-1to2 v$version"]) @@ -11,7 +11,7 @@ version=2.7.1 # ARGBASH_GO() # needed because of Argbash --> m4_ignore([ -### START OF CODE GENERATED BY Argbash v2.7.1 one line above ### +### START OF CODE GENERATED BY Argbash v2.8.0 one line above ### # Argbash is a bash code generator used to get arguments parsing right. # Argbash is FREE SOFTWARE, see https://argbash.io for more info diff --git a/bin/argbash-init b/bin/argbash-init index 6db34aa..d210f70 100755 --- a/bin/argbash-init +++ b/bin/argbash-init @@ -4,7 +4,7 @@ # SC2001: See if you can use ${variable//search/replace} instead. # SC2016: Expressions don't expand in single quotes, use double quotes for that. -version=2.7.1 +version=2.8.0 # ARG_POSITIONAL_SINGLE([output],[Name of the output template],[-]) # ARG_OPTIONAL_INCREMENTAL([separate],[s],[Separate the parsing logic (specify two times for complete separation)]) # ARG_OPTIONAL_BOOLEAN([hints],[],[Whether to write hints to the script template]) @@ -19,7 +19,7 @@ version=2.7.1 # ARGBASH_GO() # needed because of Argbash --> m4_ignore([ -### START OF CODE GENERATED BY Argbash v2.7.1 one line above ### +### START OF CODE GENERATED BY Argbash v2.8.0 one line above ### # Argbash is a bash code generator used to get arguments parsing right. # Argbash is FREE SOFTWARE, see https://argbash.io for more info diff --git a/doc/_static/argbash-version.txt b/doc/_static/argbash-version.txt index b82d380..5f83be2 100644 --- a/doc/_static/argbash-version.txt +++ b/doc/_static/argbash-version.txt @@ -1,3 +1,3 @@ -argbash 2.7.1 +argbash 2.8.0 Argbash is an argument parser generator for Bash. diff --git a/doc/_static/wrapper-output-action.txt b/doc/_static/wrapper-output-action.txt index d89473e..f8540c2 100644 --- a/doc/_static/wrapper-output-action.txt +++ b/doc/_static/wrapper-output-action.txt @@ -16,6 +16,7 @@ Contents of '../src' matching '*.m4': output-bash-script.m4: 1 kiB output-completion.m4: 4 kiB output-docopt.m4: 0 kiB + output-manpage-defs.m4: 1 kiB output-manpage.m4: 1 kiB output-posix-script.m4: 3 kiB output-strip-all.m4: 0 kiB diff --git a/doc/guide.rst b/doc/guide.rst index f9043cb..0f41031 100644 --- a/doc/guide.rst +++ b/doc/guide.rst @@ -79,6 +79,7 @@ So let's get back to argument types. Below, is a list of argument types and macros that you have to write to support those (e.g. ``ARGBASH_GO`` is a macro and ``ARG_OPTIONAL_BOOLEAN([verbose], [Verbose mode])`` is a macro called wit two arguments --- ``verbose`` and ``Verbose mode``). Place those macros in your files as ``bash`` comments. + Your script ----------- diff --git a/resources/examples/minimal-raw.m4 b/resources/examples/minimal-raw.m4 index 0d5817a..687e32e 100755 --- a/resources/examples/minimal-raw.m4 +++ b/resources/examples/minimal-raw.m4 @@ -2,7 +2,7 @@ # m4_ignore( echo "This is just a script template, not the script (yet) - pass it to 'argbash' to fix this." >&2 -exit 11 #)Created by argbash-init v2.7.1 +exit 11 #)Created by argbash-init v2.8.0 # ARG_OPTIONAL_SINGLE([option]) # ARG_OPTIONAL_BOOLEAN([print]) # ARG_POSITIONAL_SINGLE([positional-arg]) diff --git a/resources/examples/minimal.m4 b/resources/examples/minimal.m4 index 7825dd2..504e704 100644 --- a/resources/examples/minimal.m4 +++ b/resources/examples/minimal.m4 @@ -2,7 +2,7 @@ # m4_ignore( echo "This is just a script template, not the script (yet) - pass it to 'argbash' to fix this." >&2 -exit 11 #)Created by argbash-init v2.7.1 +exit 11 #)Created by argbash-init v2.8.0 # ARG_OPTIONAL_SINGLE([option], o, [A option with short and long flags and default], [boo]) # ARG_OPTIONAL_BOOLEAN([print], , [A boolean option with long flag (and implicit default: off)]) # ARG_POSITIONAL_SINGLE([positional-arg], [Positional arg description], ) diff --git a/resources/examples/simple-parsing.sh b/resources/examples/simple-parsing.sh index 0ea93ab..175f664 100755 --- a/resources/examples/simple-parsing.sh +++ b/resources/examples/simple-parsing.sh @@ -8,7 +8,7 @@ # ARGBASH_SET_INDENT([ ]) # ARGBASH_GO() # needed because of Argbash --> m4_ignore([ -### START OF CODE GENERATED BY Argbash v2.7.1 one line above ### +### START OF CODE GENERATED BY Argbash v2.8.0 one line above ### # Argbash is a bash code generator used to get arguments parsing right. # Argbash is FREE SOFTWARE, see https://argbash.io for more info diff --git a/resources/examples/simple-wrapper.sh b/resources/examples/simple-wrapper.sh index 49fadf6..fa2e319 100755 --- a/resources/examples/simple-wrapper.sh +++ b/resources/examples/simple-wrapper.sh @@ -8,7 +8,7 @@ # ARGBASH_SET_INDENT([ ]) # ARGBASH_GO() # needed because of Argbash --> m4_ignore([ -### START OF CODE GENERATED BY Argbash v2.7.1 one line above ### +### START OF CODE GENERATED BY Argbash v2.8.0 one line above ### # Argbash is a bash code generator used to get arguments parsing right. # Argbash is FREE SOFTWARE, see https://argbash.io for more info @@ -135,7 +135,7 @@ assign_positional_args 1 "${_positionals[@]}" # OTHER STUFF GENERATED BY Argbash _args_simple_parsing=("${_args_simple_parsing_opt[@]}" "${_args_simple_parsing_pos[@]}") -script_dir="$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd)" || die "Couldn't determine the script's running directory, which probably matters, bailing out" 2 +script_dir="$(cd "$(dirname "$(readlink -e "${BASH_SOURCE[0]}")")" && pwd)" || die "Couldn't determine the script's running directory, which probably matters, bailing out" 2 ### END OF CODE GENERATED BY Argbash (sortof) ### ]) # [ <-- needed because of Argbash diff --git a/resources/examples/simple.sh b/resources/examples/simple.sh index a2e5921..1e47919 100755 --- a/resources/examples/simple.sh +++ b/resources/examples/simple.sh @@ -4,12 +4,12 @@ # INCLUDE_PARSING_CODE([simple-parsing.sh]) # ARGBASH_GO() # needed because of Argbash --> m4_ignore([ -### START OF CODE GENERATED BY Argbash v2.7.1 one line above ### +### START OF CODE GENERATED BY Argbash v2.8.0 one line above ### # Argbash is a bash code generator used to get arguments parsing right. # Argbash is FREE SOFTWARE, see https://argbash.io for more info # OTHER STUFF GENERATED BY Argbash -script_dir="$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd)" || die "Couldn't determine the script's running directory, which probably matters, bailing out" 2 +script_dir="$(cd "$(dirname "$(readlink -e "${BASH_SOURCE[0]}")")" && pwd)" || die "Couldn't determine the script's running directory, which probably matters, bailing out" 2 . "$script_dir/simple-parsing.sh" # '.' means 'source' diff --git a/src/version b/src/version index 860487c..834f262 100644 --- a/src/version +++ b/src/version @@ -1 +1 @@ -2.7.1 +2.8.0