Skip to content

Commit

Permalink
The 2.9.0 release.
Browse files Browse the repository at this point in the history
  • Loading branch information
matejak committed Jul 31, 2020
1 parent 4587817 commit 850cabf
Show file tree
Hide file tree
Showing 15 changed files with 46 additions and 38 deletions.
2 changes: 1 addition & 1 deletion ChangeLog
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
2.9.0 (TBA)
2.9.0 (2020-08-01)
------------------

Buxfixes:
Expand Down
8 changes: 4 additions & 4 deletions bin/argbash
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@

# ARGBASH_GO()
# needed because of Argbash --> m4_ignore([
### START OF CODE GENERATED BY Argbash v2.8.1 one line above ###
### START OF CODE GENERATED BY Argbash v2.9.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

Expand Down Expand Up @@ -201,11 +201,11 @@ parse_commandline()
exit 0
;;
-v|--version)
printf '%s %s\n\n%s\n' "argbash" "2.8.1" 'Argbash is an argument parser generator for Bash.'
printf '%s %s\n\n%s\n' "argbash" "2.9.0" 'Argbash is an argument parser generator for Bash.'
exit 0
;;
-v*)
printf '%s %s\n\n%s\n' "argbash" "2.8.1" 'Argbash is an argument parser generator for Bash.'
printf '%s %s\n\n%s\n' "argbash" "2.9.0" 'Argbash is an argument parser generator for Bash.'
exit 0
;;
*)
Expand Down Expand Up @@ -495,7 +495,7 @@ then
# match against suspicious, then inverse match against correct stuff:
# #<optional whitespace>\(allowed\|another allowed\|...\)<optional whitespace><opening bracket <or> end of line>
# Then, extract all matches (assumed to be alnum chars + '_') from grep and put them in the error msg.
grep_output="$(printf "%s" "$output" | grep '^#\s*\(ARG_\|ARGBASH\)' | grep -v '^#\s*\(ARGBASH_SET_INDENT\|ARG_OPTIONAL_SINGLE\|ARG_VERSION\|ARG_VERSION_AUTO\|ARG_HELP\|ARG_OPTIONAL_INCREMENTAL\|ARG_OPTIONAL_REPEATED\|ARG_VERBOSE\|ARG_OPTIONAL_BOOLEAN\|ARG_OPTIONAL_ACTION\|ARG_POSITIONAL_SINGLE\|ARG_POSITIONAL_INF\|ARG_POSITIONAL_MULTI\|ARG_POSITIONAL_DOUBLEDASH\|ARG_OPTION_STACKING\|ARG_RESTRICT_VALUES\|ARG_DEFAULTS_POS\|ARG_LEFTOVERS\|ARGBASH_WRAP\|INCLUDE_PARSING_CODE\|DEFINE_SCRIPT_DIR\|DEFINE_SCRIPT_DIR_GNU\|ARGBASH_SET_DELIM\|ARGBASH_GO\|ARGBASH_PREPARE\|ARG_TYPE_GROUP\|ARG_TYPE_GROUP_SET\|ARG_USE_ENV\|ARG_USE_PROG\)\s*\((\|$\)' | sed -e 's/#\s*\([[:alnum:]_]*\).*/\1 /' | tr -d '\n\r')"
grep_output="$(printf "%s" "$output" | grep '^#\s*\(ARG_\|ARGBASH\)' | grep -v '^#\s*\(ARGBASH_SET_INDENT\|ARG_OPTIONAL_SINGLE\|ARG_VERSION\|ARG_VERSION_AUTO\|ARG_HELP\|ARG_OPTIONAL_INCREMENTAL\|ARG_OPTIONAL_REPEATED\|ARG_VERBOSE\|ARG_OPTIONAL_BOOLEAN\|ARG_OPTIONAL_ACTION\|ARG_POSITIONAL_SINGLE\|ARG_POSITIONAL_INF\|ARG_POSITIONAL_MULTI\|ARG_POSITIONAL_DOUBLEDASH\|ARG_OPTION_STACKING\|ARG_RESTRICT_VALUES\|ARG_DEFAULTS_POS\|ARG_LEFTOVERS\|ARGBASH_WRAP\|INCLUDE_PARSING_CODE\|DEFINE_LOAD_LIBRARY\|DEFINE_SCRIPT_DIR\|DEFINE_SCRIPT_DIR_GNU\|ARGBASH_SET_DELIM\|ARGBASH_GO\|ARGBASH_PREPARE\|ARG_TYPE_GROUP\|ARG_TYPE_GROUP_SET\|ARG_USE_ENV\|ARG_USE_PROG\)\s*\((\|$\)' | sed -e 's/#\s*\([[:alnum:]_]*\).*/\1 /' | tr -d '\n\r')"
test -n "$grep_output" && die "Your script contains possible misspelled Argbash macros: $grep_output" 1
fi
if test "$outfname" != '-'
Expand Down
4 changes: 2 additions & 2 deletions bin/argbash-1to2
Original file line number Diff line number Diff line change
Expand Up @@ -3,15 +3,15 @@
# shellcheck disable=SC2016
# SC2016: Expressions don't expand in single quotes, use double quotes for that.

version=2.8.1
version=2.9.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"])
# ARG_HELP([Convert a template for argbash>=1,<2 to argbash>=2,<3])

# ARGBASH_GO()
# needed because of Argbash --> m4_ignore([
### START OF CODE GENERATED BY Argbash v2.8.1 one line above ###
### START OF CODE GENERATED BY Argbash v2.9.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

Expand Down
6 changes: 3 additions & 3 deletions bin/argbash-init
Original file line number Diff line number Diff line change
Expand Up @@ -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.8.1
version=2.9.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])
Expand All @@ -19,7 +19,7 @@ version=2.8.1

# ARGBASH_GO()
# needed because of Argbash --> m4_ignore([
### START OF CODE GENERATED BY Argbash v2.8.1 one line above ###
### START OF CODE GENERATED BY Argbash v2.9.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

Expand Down Expand Up @@ -363,7 +363,7 @@ do_script_separate()

do_body()
{
echo "# vvv PLACE YOUR CODE GOES HERE vvv"
echo "# vvv PLACE YOUR CODE HERE vvv"
if test "${#_variables[@]}" -gt 0; then
echo "# For example:"
for stat in "${_variables[@]}"
Expand Down
2 changes: 1 addition & 1 deletion doc/_static/argbash-version.txt
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
argbash 2.8.1
argbash 2.9.0

Argbash is an argument parser generator for Bash.
16 changes: 9 additions & 7 deletions doc/_static/minimal.patch
Original file line number Diff line number Diff line change
@@ -1,25 +1,26 @@
--- minimal-raw.m4 2017-12-06 23:51:13.985545630 +0100
+++ minimal.m4 2017-12-06 23:54:30.169992192 +0100
@@ -3,16 +3,22 @@
--- minimal-raw.m4 2020-08-01 00:01:13.050519113 +0200
+++ minimal.m4 2020-08-01 00:01:05.053955492 +0200
@@ -3,20 +3,26 @@
# 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 v@VERSION@
-# ARG_OPTIONAL_SINGLE([option])
-# ARG_OPTIONAL_BOOLEAN([print])
-# ARG_POSITIONAL_SINGLE([positional-arg])
-# ARG_DEFAULTS_POS
-# ARG_HELP([<The general help message of my script>])
+# 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], )
+# ARG_DEFAULTS_POS
# ARG_DEFAULTS_POS
-# ARG_HELP([<The general help message of my script>])
+# ARG_HELP([This is a minimal demo of Argbash potential])
+# ARG_VERSION([echo $0 v0.1])
+# ARGBASH_SET_INDENT([ ])
# ARGBASH_GO

# [ <-- needed because of Argbash

# vvv PLACE YOUR CODE HERE vvv
# For example:
-printf 'Value of --%s: %s\n' 'option' "$_arg_option"
-printf "'%s' is %s\\n" 'print' "$_arg_print"
-printf "Value of '%s': %s\\n" 'positional-arg' "$_arg_positional_arg"
Expand All @@ -31,4 +32,5 @@
+ echo "Not telling anything, print not requested"
+fi

# ] <-- needed because of Argbash
# ^^^ TERMINATE YOUR CODE BEFORE THE BOTTOM ARGBASH MARKER ^^^

4 changes: 2 additions & 2 deletions doc/_static/wrapper-output-action.txt
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ Contents of '../src' matching '*.m4':
argbash-lib.m4: 0 kiB
argbash.m4: 10 kiB
argument_value_types.m4: 5 kiB
collectors.m4: 20 kiB
collectors.m4: 21 kiB
constants.m4: 0 kiB
default_settings.m4: 0 kiB
docopt.m4: 3 kiB
Expand All @@ -23,7 +23,7 @@ Contents of '../src' matching '*.m4':
output-strip-none.m4: 0 kiB
output-strip-user-content.m4: 0 kiB
progs.m4: 2 kiB
stuff.m4: 46 kiB
stuff.m4: 47 kiB
utilities.m4: 11 kiB
value_validators.m4: 5 kiB
Contents of '../resources/examples' matching '*.m4':
Expand Down
2 changes: 1 addition & 1 deletion doc/install.rst
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@ If you want to use Argbash locally, you have to download the software package an
* Supply ``INSTALL_COMPLETION=yes`` as an installation argument to install bash completion for ``argbash`` to ``$(SYSCONFDIR)/bash_completion.d``.
The default ``SYSCONFDIR`` is ``/etc``, but you may override it in the same way as you can override the ``PREFIX`` variable.

* To be able to let Argbash :ref:`generate manpages <manpage_output>`, :ref:`rst2man <https://docutils.sourceforge.io/sandbox/manpage-writer/rst2man.txt>` needs to be installed on your system. It's part of the Python package :ref:`docutils <https://pypi.org/project/docutils/>` which can be installed on Debian/Ubuntu using ``sudo apt install python3-docutils``.
* To be able to let Argbash :ref:`generate manpages <manpage_output>`, `rst2man <https://docutils.sourceforge.io/sandbox/manpage-writer/rst2man.txt>`_ needs to be installed on your system. It's part of the Python package `docutils <https://pypi.org/project/docutils/>`_ which can be installed on Debian/Ubuntu using ``sudo apt install python3-docutils``.

* Run some checks by executing: ``make check`` (still in the ``resources`` folder).
You should get a message ``All is OK`` at the bottom.
Expand Down
6 changes: 5 additions & 1 deletion resources/examples/minimal-raw.m4
Original file line number Diff line number Diff line change
Expand Up @@ -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.8.1
exit 11 #)Created by argbash-init v2.9.0
# ARG_OPTIONAL_SINGLE([option])
# ARG_OPTIONAL_BOOLEAN([print])
# ARG_POSITIONAL_SINGLE([positional-arg])
Expand All @@ -12,8 +12,12 @@ exit 11 #)Created by argbash-init v2.8.1

# [ <-- needed because of Argbash

# vvv PLACE YOUR CODE HERE vvv
# For example:
printf 'Value of --%s: %s\n' 'option' "$_arg_option"
printf "'%s' is %s\\n" 'print' "$_arg_print"
printf "Value of '%s': %s\\n" 'positional-arg' "$_arg_positional_arg"

# ^^^ TERMINATE YOUR CODE BEFORE THE BOTTOM ARGBASH MARKER ^^^

# ] <-- needed because of Argbash
6 changes: 5 additions & 1 deletion resources/examples/minimal.m4
Original file line number Diff line number Diff line change
Expand Up @@ -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.8.1
exit 11 #)Created by argbash-init v2.9.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], )
Expand All @@ -14,6 +14,8 @@ exit 11 #)Created by argbash-init v2.8.1

# [ <-- needed because of Argbash

# vvv PLACE YOUR CODE HERE vvv
# For example:
if [ "$_arg_print" = on ]
then
echo "Positional arg value: '$_arg_positional_arg'"
Expand All @@ -22,4 +24,6 @@ else
echo "Not telling anything, print not requested"
fi

# ^^^ TERMINATE YOUR CODE BEFORE THE BOTTOM ARGBASH MARKER ^^^

# ] <-- needed because of Argbash
9 changes: 4 additions & 5 deletions resources/examples/simple-parsing.sh
Original file line number Diff line number Diff line change
Expand Up @@ -8,18 +8,17 @@
# ARGBASH_SET_INDENT([ ])
# ARGBASH_GO()
# needed because of Argbash --> m4_ignore([
### START OF CODE GENERATED BY Argbash v2.8.1 one line above ###
### START OF CODE GENERATED BY Argbash v2.9.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


die()
{
local _ret=$2
test -n "$_ret" || _ret=1
test "$_PRINT_HELP" = yes && print_help >&2
local _ret="${2:-1}"
test "${_PRINT_HELP:-no}" = yes && print_help >&2
echo "$1" >&2
exit ${_ret}
exit "${_ret}"
}


Expand Down
11 changes: 5 additions & 6 deletions resources/examples/simple-wrapper.sh
Original file line number Diff line number Diff line change
@@ -1,25 +1,24 @@
#!/bin/bash

# DEFINE_SCRIPT_DIR()_DEFINE_SCRIPT_DIR([],[cd "$(dirname "${BASH_SOURCE[0]}")" && pwd])
# DEFINE_SCRIPT_DIR()
# ARG_POSITIONAL_INF([directory],[Directories to go through],[1])
# ARG_OPTIONAL_SINGLE([glob],[],[What files to match in the directory],[*])
# ARGBASH_WRAP([simple-parsing],[filename])
# ARG_HELP([This program tells you size of specified files in given directories in units you choose.])
# ARGBASH_SET_INDENT([ ])
# ARGBASH_GO()
# needed because of Argbash --> m4_ignore([
### START OF CODE GENERATED BY Argbash v2.8.1 one line above ###
### START OF CODE GENERATED BY Argbash v2.9.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


die()
{
local _ret=$2
test -n "$_ret" || _ret=1
test "$_PRINT_HELP" = yes && print_help >&2
local _ret="${2:-1}"
test "${_PRINT_HELP:-no}" = yes && print_help >&2
echo "$1" >&2
exit ${_ret}
exit "${_ret}"
}


Expand Down
4 changes: 2 additions & 2 deletions resources/examples/simple.sh
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
#!/bin/bash

# DEFINE_SCRIPT_DIR([])_DEFINE_SCRIPT_DIR([],[cd "$(dirname "${BASH_SOURCE[0]}")" && pwd])
# DEFINE_SCRIPT_DIR([])
# INCLUDE_PARSING_CODE([simple-parsing.sh])
# ARGBASH_GO()
# needed because of Argbash --> m4_ignore([
### START OF CODE GENERATED BY Argbash v2.8.1 one line above ###
### START OF CODE GENERATED BY Argbash v2.9.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

Expand Down
2 changes: 1 addition & 1 deletion src/argbash-init.m4
Original file line number Diff line number Diff line change
Expand Up @@ -177,7 +177,7 @@ do_script_separate()

do_body()
{
echo "# vvv PLACE YOUR CODE GOES HERE vvv"
echo "# vvv PLACE YOUR CODE HERE vvv"
if test "${#_variables[@]}" -gt 0; then
echo "# For example:"
for stat in "${_variables[@]}"
Expand Down
2 changes: 1 addition & 1 deletion src/version
Original file line number Diff line number Diff line change
@@ -1 +1 @@
2.8.1
2.9.0

0 comments on commit 850cabf

Please sign in to comment.