"Fossies" - the Fresh Open Source Software Archive  

Source code changes of the file "bin/argbash" 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  (argbash-2.9.0):argbash  (argbash-2.10.0)
skipping to change at line 26 skipping to change at line 26
# ARG_OPTIONAL_REPEATED([search],[I],[Directories to search for the wrapped scri pts (directory of the template will be added to the end of the list)],["."]) # ARG_OPTIONAL_REPEATED([search],[I],[Directories to search for the wrapped scri pts (directory of the template will be added to the end of the list)],["."])
# ARG_OPTIONAL_SINGLE([debug],[],[(developer option) Tell autom4te to trace a ma cro]) # ARG_OPTIONAL_SINGLE([debug],[],[(developer option) Tell autom4te to trace a ma cro])
# ARG_TYPE_GROUP_SET([content],[content],[strip],[none,user-content,all]) # ARG_TYPE_GROUP_SET([content],[content],[strip],[none,user-content,all])
# ARG_TYPE_GROUP_SET([type],[type],[type],[bash-script,posix-script,manpage,manp age-defs,completion,docopt]) # ARG_TYPE_GROUP_SET([type],[type],[type],[bash-script,posix-script,manpage,manp age-defs,completion,docopt])
# ARG_DEFAULTS_POS([]) # ARG_DEFAULTS_POS([])
# ARG_HELP([Argbash is an argument parser generator for Bash.]) # ARG_HELP([Argbash is an argument parser generator for Bash.])
# ARG_VERSION_AUTO([_ARGBASH_VERSION]) # ARG_VERSION_AUTO([_ARGBASH_VERSION])
# 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 198 skipping to change at line 198
;; ;;
-h|--help) -h|--help)
print_help print_help
exit 0 exit 0
;; ;;
-h*) -h*)
print_help print_help
exit 0 exit 0
;; ;;
-v|--version) -v|--version)
printf '%s %s\n\n%s\n' "argbash" "2.9.0" 'Argbash is an argument parser generator for Bash.' printf '%s %s\n\n%s\n' "argbash" "2.10.0" 'Argbas h is an argument parser generator for Bash.'
exit 0 exit 0
;; ;;
-v*) -v*)
printf '%s %s\n\n%s\n' "argbash" "2.9.0" 'Argbash is an argument parser generator for Bash.' printf '%s %s\n\n%s\n' "argbash" "2.10.0" 'Argbas h is an argument parser generator for Bash.'
exit 0 exit 0
;; ;;
*) *)
_last_positional="$1" _last_positional="$1"
_positionals+=("$_last_positional") _positionals+=("$_last_positional")
_positionals_count=$((_positionals_count + 1)) _positionals_count=$((_positionals_count + 1))
;; ;;
esac esac
shift shift
done done
skipping to change at line 241 skipping to change at line 241
eval "$_positional_name=\${1}" || die "Error during argument pars ing, possibly an Argbash bug." 1 eval "$_positional_name=\${1}" || die "Error during argument pars ing, possibly an Argbash bug." 1
shift shift
done done
} }
parse_commandline "$@" parse_commandline "$@"
handle_passed_args_count handle_passed_args_count
assign_positional_args 1 "${_positionals[@]}" assign_positional_args 1 "${_positionals[@]}"
# OTHER STUFF GENERATED BY Argbash # OTHER STUFF GENERATED BY Argbash
script_dir="$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd)" || die "Couldn't dete rmine the script's running directory, which probably matters, bailing out" 2 script_dir="$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd)" || { echo "Couldn't d etermine the script's running directory, which probably matters, bailing out" >& 2; exit 2; }
# Validation of values # Validation of values
### END OF CODE GENERATED BY Argbash (sortof) ### ]) ### END OF CODE GENERATED BY Argbash (sortof) ### ])
# [ <-- needed because of Argbash # [ <-- needed because of Argbash
# #
_files_to_clean=() _files_to_clean=()
cleanup() cleanup()
{ {
skipping to change at line 483 skipping to change at line 483
# We may use some of the wrapping stuff, so let's fill the _wrapped_defns # We may use some of the wrapping stuff, so let's fill the _wrapped_defns
settle_wrapped_fname "$infile" settle_wrapped_fname "$infile"
assert_m4_files_are_readable assert_m4_files_are_readable
output="$(do_stuff "$infile" "$outfname" "$_arg_type")" || die "" "$?" output="$(do_stuff "$infile" "$outfname" "$_arg_type")" || die "" "$?"
if test "$_arg_check_typos" = on if test "$_arg_check_typos" = on
then then
# match against suspicious, then inverse match against correct stuff: # match against suspicious, then inverse match against correct stuff:
# #<optional whitespace>\(allowed\|another allowed\|...\)<optional whites pace><opening bracket <or> end of line> # #<optional whitespace>\(allowed\|another allowed\|...\)<optional whites pace><opening bracket <or> end of line>
# Then, extract all matches (assumed to be alnum chars + '_') from grep a nd put them in the error msg. # Then, extract all matches (assumed to be alnum chars + '_') from grep a nd put them in the error msg.
grep_output="$(printf "%s" "$output" | grep '^#\s*\(ARG_\|ARGBASH\)' | gr ep -v '^#\s*\(ARGBASH_SET_INDENT\|ARG_OPTIONAL_SINGLE\|ARG_VERSION\|ARG_VERSION_ AUTO\|ARG_HELP\|ARG_OPTIONAL_INCREMENTAL\|ARG_OPTIONAL_REPEATED\|ARG_VERBOSE\|AR G_OPTIONAL_BOOLEAN\|ARG_OPTIONAL_ACTION\|ARG_POSITIONAL_SINGLE\|ARG_POSITIONAL_I NF\|ARG_POSITIONAL_MULTI\|ARG_POSITIONAL_DOUBLEDASH\|ARG_OPTION_STACKING\|ARG_RE STRICT_VALUES\|ARG_DEFAULTS_POS\|ARG_LEFTOVERS\|ARGBASH_WRAP\|INCLUDE_PARSING_CO DE\|DEFINE_LOAD_LIBRARY\|DEFINE_SCRIPT_DIR\|DEFINE_SCRIPT_DIR_GNU\|ARGBASH_SET_D ELIM\|ARGBASH_GO\|ARGBASH_PREPARE\|ARG_TYPE_GROUP\|ARG_TYPE_GROUP_SET\|ARG_USE_E NV\|ARG_USE_PROG\)\s*\((\|$\)' | sed -e 's/#\s*\([[:alnum:]_]*\).*/\1 /' | tr -d '\n\r')" grep_output="$(printf "%s" "$output" | grep '^#\s*\(ARG_\|ARGBASH\)' | gr ep -v '^#\s*\(ARGBASH_SET_INDENT\|ARG_OPTIONAL_SINGLE\|ARG_VERSION\|ARG_VERSION_ AUTO\|ARG_HELP\|ARG_OPTIONAL_INCREMENTAL\|ARG_OPTIONAL_REPEATED\|ARG_VERBOSE\|AR G_OPTIONAL_BOOLEAN\|ARG_OPTIONAL_ACTION\|ARG_POSITIONAL_SINGLE\|ARG_POSITIONAL_I NF\|ARG_POSITIONAL_MULTI\|ARG_POSITIONAL_DOUBLEDASH\|ARG_OPTION_STACKING\|ARG_RE STRICT_VALUES\|ARG_DEFAULTS_POS\|ARG_LEFTOVERS\|ARGBASH_WRAP\|INCLUDE_PARSING_CO DE\|DEFINE_LOAD_LIBRARY\|DEFINE_SCRIPT_DIR\|DEFINE_SCRIPT_DIR_GNU\|ARGBASH_SET_D ELIM\|ARGBASH_GO\|ARGBASH_PREPARE\|ARG_TYPE_GROUP\|ARG_TYPE_GROUP_SET\|ARG_USE_E NV\|ARG_USE_PROGRAM\)\s*\((\|$\)' | sed -e 's/#\s*\([[:alnum:]_]*\).*/\1 /' | tr -d '\n\r')"
test -n "$grep_output" && die "Your script contains possible misspelled A rgbash macros: $grep_output" 1 test -n "$grep_output" && die "Your script contains possible misspelled A rgbash macros: $grep_output" 1
fi fi
if test "$outfname" != '-' if test "$outfname" != '-'
then then
printf "%s\\n" "$output" > "$outfname" printf "%s\\n" "$output" > "$outfname"
set_output_permission "$outfname" "$_arg_type" set_output_permission "$outfname" "$_arg_type"
else else
printf "%s\\n" "$output" printf "%s\\n" "$output"
fi fi
 End of changes. 5 change blocks. 
5 lines changed or deleted 5 lines changed or added

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