"Fossies" - the Fresh Open Source Software Archive  

Source code changes of the file "bin/argbash-init" between
argbash-2.9.0.tar.gz and argbash-2.10.0.tar.gz

About: argbash is a bash code generator that can assist you in writing scripts that accept arguments.

argbash-init  (argbash-2.9.0):argbash-init  (argbash-2.10.0)
#!/bin/bash #!/bin/bash
# shellcheck disable=SC2001,SC2016 # shellcheck disable=SC2001,SC2016
# SC2001: See if you can use ${variable//search/replace} instead. # SC2001: See if you can use ${variable//search/replace} instead.
# SC2016: Expressions don't expand in single quotes, use double quotes for that. # SC2016: Expressions don't expand in single quotes, use double quotes for that.
version=2.9.0 version=2.10.0
# ARG_POSITIONAL_SINGLE([output],[Name of the output template],[-]) # ARG_POSITIONAL_SINGLE([output],[Name of the output template],[-])
# ARG_OPTIONAL_INCREMENTAL([separate],[s],[Separate the parsing logic (specify t wo times for complete separation)]) # ARG_OPTIONAL_INCREMENTAL([separate],[s],[Separate the parsing logic (specify t wo times for complete separation)])
# ARG_OPTIONAL_BOOLEAN([hints],[],[Whether to write hints to the script template ]) # ARG_OPTIONAL_BOOLEAN([hints],[],[Whether to write hints to the script template ])
# ARG_OPTIONAL_REPEATED([pos],[],[Add a single-valued positional argument]) # ARG_OPTIONAL_REPEATED([pos],[],[Add a single-valued positional argument])
# ARG_OPTIONAL_REPEATED([opt],[],[Add an single-valued optional argument]) # ARG_OPTIONAL_REPEATED([opt],[],[Add an single-valued optional argument])
# ARG_OPTIONAL_REPEATED([opt-bool],[],[Add an optional boolean argument]) # ARG_OPTIONAL_REPEATED([opt-bool],[],[Add an optional boolean argument])
# ARG_OPTIONAL_REPEATED([wrap],[],[What script(s) to wrap]) # ARG_OPTIONAL_REPEATED([wrap],[],[What script(s) to wrap])
# ARG_OPTIONAL_SINGLE([mode],[m],[The slider between feature-rich and simple scr ipt.],[default]) # ARG_OPTIONAL_SINGLE([mode],[m],[The slider between feature-rich and simple scr ipt.],[default])
# ARG_TYPE_GROUP_SET([mode],[MODE],[mode],[default,full,minimal]) # ARG_TYPE_GROUP_SET([mode],[MODE],[mode],[default,full,minimal])
# ARG_VERSION([echo "argbash-init v$version"]) # ARG_VERSION([echo "argbash-init v$version"])
# ARG_HELP([Make a template for scripts.]) # ARG_HELP([Make a template for scripts.])
# ARGBASH_GO() # ARGBASH_GO()
# needed because of Argbash --> m4_ignore([ # needed because of Argbash --> m4_ignore([
### START OF CODE GENERATED BY Argbash v2.9.0 one line above ### ### START OF CODE GENERATED BY Argbash v2.10.0 one line above ###
# Argbash is a bash code generator used to get arguments parsing right. # Argbash is a bash code generator used to get arguments parsing right.
# Argbash is FREE SOFTWARE, see https://argbash.io for more info # Argbash is FREE SOFTWARE, see https://argbash.io for more info
die() die()
{ {
local _ret="${2:-1}" local _ret="${2:-1}"
test "${_PRINT_HELP:-no}" = yes && print_help >&2 test "${_PRINT_HELP:-no}" = yes && print_help >&2
echo "$1" >&2 echo "$1" >&2
exit "${_ret}" exit "${_ret}"
} }
skipping to change at line 378 skipping to change at line 378
do_stuff() do_stuff()
{ {
do_header "$1" do_header "$1"
do_args do_args
do_args_footer do_args_footer
test "$_arg_separate" = 0 && do_body_protected test "$_arg_separate" = 0 && do_body_protected
} }
outfname="$_arg_output" outfname="$_arg_output"
# we canonicize the empty string input to output filename to the dash
test -n "$outfname" || outfname='-'
test "$outfname" = "-" -a "$_arg_separate" -gt 0 && die "If you want to separate parsing and script body, you have to specify the outname, stdout doesn't work." test "$outfname" = "-" -a "$_arg_separate" -gt 0 && die "If you want to separate parsing and script body, you have to specify the outname, stdout doesn't work."
if test "$outfname" = '-' if test "$outfname" = '-'
then then
do_stuff 'script' do_stuff 'script'
else else
if test "$_arg_separate" = 0 if test "$_arg_separate" = 0
then then
do_stuff 'script' > "$outfname" do_stuff 'script' > "$outfname"
else else
 End of changes. 3 change blocks. 
2 lines changed or deleted 4 lines changed or added

Home  |  About  |  Features  |  All  |  Newest  |  Dox  |  Diffs  |  RSS Feeds  |  Screenshots  |  Comments  |  Imprint  |  Privacy  |  HTTP(S)