Skip to content

Commit

Permalink
Finalized version 2.1
Browse files Browse the repository at this point in the history
  • Loading branch information
matejak committed Aug 26, 2016
1 parent e150cb3 commit ed10dbf
Show file tree
Hide file tree
Showing 9 changed files with 28 additions and 33 deletions.
4 changes: 2 additions & 2 deletions ChangeLog
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
2.1.0 (TBA)
2.1.0 (2016-08-26)
------------------

Incompatible changes (minor):
Expand All @@ -7,7 +7,7 @@ Incompatible changes (minor):

New features:

* Support for `=`-style of argument passing (`--some-opt=value` as well as `--some-opt value` are supported)
* Support for configuration of argument-value delimiters (space and equal sign are supported - `--some-opt=value` as well as `--some-opt value` may work)

Bugfixes:

Expand Down
4 changes: 2 additions & 2 deletions bin/argbash
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
#!/bin/bash

version=2.0.0
version=2.1.0
# DEFINE_SCRIPT_DIR()
# ARG_POSITIONAL_SINGLE([input],[The input template file])
# ARG_OPTIONAL_SINGLE([output],[o],[Name of the output file (pass '-' for stdout)],[-])
Expand All @@ -12,7 +12,7 @@ version=2.0.0

# ARGBASH_GO()
# needed because of Argbash --> m4_ignore([
### START OF CODE GENERATED BY Argbash v2.0.0 one line above ###
### START OF CODE GENERATED BY Argbash v2.1.0 one line above ###
# Argbash is a bash code generator used to get arguments parsing right.
# Argbash is FREE SOFTWARE, know your rights: https://github.com/matejak/argbash

Expand Down
4 changes: 2 additions & 2 deletions bin/argbash-1to2
Original file line number Diff line number Diff line change
@@ -1,14 +1,14 @@
#!/bin/bash

version=2.0.0
version=2.1.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<2 to argbash>=2,<3])

# ARGBASH_GO()
# needed because of Argbash --> m4_ignore([
### START OF CODE GENERATED BY Argbash v2.0.0 one line above ###
### START OF CODE GENERATED BY Argbash v2.1.0 one line above ###
# Argbash is a bash code generator used to get arguments parsing right.
# Argbash is FREE SOFTWARE, know your rights: https://github.com/matejak/argbash

Expand Down
13 changes: 6 additions & 7 deletions resources/examples/minimal.sh
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@
# ARGBASH_SET_INDENT([ ])
# ARGBASH_GO()
# needed because of Argbash --> m4_ignore([
### START OF CODE GENERATED BY Argbash v2.0.0 one line above ###
### START OF CODE GENERATED BY Argbash v2.1.0 one line above ###
# Argbash is a bash code generator used to get arguments parsing right.
# Argbash is FREE SOFTWARE, know your rights: https://github.com/matejak/argbash

Expand All @@ -32,8 +32,8 @@ print_help ()
echo "This is a minimal demo of Argbash potential"
printf 'Usage: %s [-o|--option <arg>] [--(no-)print] [-v|--version] [-h|--help] <positional-arg>\n' "$0"
printf "\t<positional-arg->: Positional arg description\n"
printf "\t-o,--option: A option with short and long flags and default (default: '%s')\n" "${_arg_option}"
printf "\t--print,--no-print: A boolean option with long flag (and implicit default: off) (%s by default)\n" "${_arg_print}"
printf "\t-o,--option: A option with short and long flags and default (default: '%s')\n" "b"
printf "\t--print,--no-print: A boolean option with long flag (and implicit default: off) (%s by default)\n" "off"
printf "\t-v,--version: Prints version\n"
printf "\t-h,--help: Prints help\n"
}
Expand All @@ -45,14 +45,13 @@ do
case "$_key" in
-o|--option|--option=*)
_val="${_key##--option=}"
if test "$_val" != "$_key"
if test "$_val" = "$_key"
then
_arg_option="$_val"
else
test $# -lt 2 && die "Missing value for the optional argument '$_key'." 1
_arg_option="$2"
_val="$2"
shift
fi
_arg_option="$_val"
;;
--no-print|--print)
_arg_print="on"
Expand Down
11 changes: 5 additions & 6 deletions resources/examples/simple-parsing.sh
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@
# ARGBASH_SET_INDENT([ ])
# ARGBASH_GO()
# needed because of Argbash --> m4_ignore([
### START OF CODE GENERATED BY Argbash v2.0.0 one line above ###
### START OF CODE GENERATED BY Argbash v2.1.0 one line above ###
# Argbash is a bash code generator used to get arguments parsing right.
# Argbash is FREE SOFTWARE, know your rights: https://github.com/matejak/argbash

Expand All @@ -31,7 +31,7 @@ print_help ()
{
echo "This program tells you size of file that you pass to it in chosen units."
printf 'Usage: %s [-u|--unit <arg>] [-v|--version] [--(no-)verbose] [-h|--help] <filename>\n' "$0"
printf "\t-u,--unit: What unit we accept (b for bytes, k for kibibytes, M for mebibytes) (default: '%s')\n" "${_arg_unit}"
printf "\t-u,--unit: What unit we accept (b for bytes, k for kibibytes, M for mebibytes) (default: '%s')\n" "b"
printf "\t-v,--version: Prints version\n"
printf "\t-h,--help: Prints help\n"
}
Expand All @@ -43,14 +43,13 @@ do
case "$_key" in
-u|--unit|--unit=*)
_val="${_key##--unit=}"
if test "$_val" != "$_key"
if test "$_val" = "$_key"
then
_arg_unit="$_val"
else
test $# -lt 2 && die "Missing value for the optional argument '$_key'." 1
_arg_unit="$2"
_val="$2"
shift
fi
_arg_unit="$_val"
;;
-v|--version)
echo $0 v0.1
Expand Down
20 changes: 9 additions & 11 deletions resources/examples/simple-wrapper.sh
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@
# ARGBASH_SET_INDENT([ ])
# ARGBASH_GO()
# needed because of Argbash --> m4_ignore([
### START OF CODE GENERATED BY Argbash v2.0.0 one line above ###
### START OF CODE GENERATED BY Argbash v2.1.0 one line above ###
# Argbash is a bash code generator used to get arguments parsing right.
# Argbash is FREE SOFTWARE, know your rights: https://github.com/matejak/argbash

Expand All @@ -34,8 +34,8 @@ print_help ()
echo "This program tells you size of specified files in given directories in units you choose."
printf 'Usage: %s [--glob <arg>] [-u|--unit <arg>] [--(no-)verbose] [-h|--help] <directory-1> [<directory-2>] ... [<directory-n>] ...\n' "$0"
printf "\t<directory>: Directories to go through\n"
printf "\t--glob: What files to match in the directory (default: '%s')\n" "${_arg_glob}"
printf "\t-u,--unit: What unit we accept (b for bytes, k for kibibytes, M for mebibytes) (default: '%s')\n" "${_arg_unit}"
printf "\t--glob: What files to match in the directory (default: '%s')\n" "*"
printf "\t-u,--unit: What unit we accept (b for bytes, k for kibibytes, M for mebibytes) (default: '%s')\n" "b"
printf "\t-h,--help: Prints help\n"
}

Expand All @@ -46,25 +46,23 @@ do
case "$_key" in
--glob|--glob=*)
_val="${_key##--glob=}"
if test "$_val" != "$_key"
if test "$_val" = "$_key"
then
_arg_glob="$_val"
else
test $# -lt 2 && die "Missing value for the optional argument '$_key'." 1
_arg_glob="$2"
_val="$2"
shift
fi
_arg_glob="$_val"
;;
-u|--unit|--unit=*)
_val="${_key##--unit=}"
if test "$_val" != "$_key"
if test "$_val" = "$_key"
then
_arg_unit="$_val"
else
test $# -lt 2 && die "Missing value for the optional argument '$_key'." 1
_arg_unit="$2"
_val="$2"
shift
fi
_arg_unit="$_val"
_args_simple_parsing_opt+=("${_key%%=*}" "$_arg_unit")
;;
--no-verbose|--verbose)
Expand Down
2 changes: 1 addition & 1 deletion resources/examples/simple.sh
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
# INCLUDE_PARSING_CODE([simple-parsing.sh])
# ARGBASH_GO()
# needed because of Argbash --> m4_ignore([
### START OF CODE GENERATED BY Argbash v2.0.0 one line above ###
### START OF CODE GENERATED BY Argbash v2.1.0 one line above ###
# Argbash is a bash code generator used to get arguments parsing right.
# Argbash is FREE SOFTWARE, know your rights: https://github.com/matejak/argbash

Expand Down
1 change: 0 additions & 1 deletion src/stuff.m4
Original file line number Diff line number Diff line change
Expand Up @@ -731,7 +731,6 @@ m4_define([_MAKE_HELP], [m4_do(
[arg], [m4_ifnblank(m4_quote(_default), [ _default])],
[repeated], [m4_ifnblank(m4_quote(_default), [ "m4_bpatsubst(m4_quote(_default), ", \\")"])],
[m4_ifnblank(m4_quote(_default), [ "_default"])])],
[m4_errprintn(m4_list_nth([_ARGS_TYPE], idx) _default)],
[
],
[m4_popdef([_default])],
Expand Down
2 changes: 1 addition & 1 deletion src/version
Original file line number Diff line number Diff line change
@@ -1 +1 @@
2.0.0
2.1.0

0 comments on commit ed10dbf

Please sign in to comment.