printf'%s\n'"Tool to aid in Node.js packaging of new releases"
printf'Usage: %s [-h|--help] [<version>]\n'"$0"
printf'\t%s\n'"<version>: Node.js release version (default: '""')"
printf'\t%s\n'"-h, --help: Prints help"
}
parse_commandline()
{
_positionals_count=0
whiletest$# -gt 0
do
_key="$1"
case"$_key" in
-h|--help)
print_help
exit0
;;
-h*)
print_help
exit0
;;
*)
_last_positional="$1"
_positionals+=("$_last_positional")
_positionals_count=$((_positionals_count +1))
;;
esac
shift
done
}
handle_passed_args_count()
{
test"${_positionals_count}" -le 1||_PRINT_HELP=yes die "FATAL ERROR: There were spurious positional arguments --- we expect between 0 and 1, but got ${_positionals_count} (the last one was: '${_last_positional}')."1
}
assign_positional_args()
{
local _positional_name _shift_for=$1
_positional_names="_arg_version "
shift"$_shift_for"
for _positional_name in ${_positional_names}
do
test$# -gt 0||break
eval"$_positional_name=\${1}"|| die "Error during argument parsing, possibly an Argbash bug."1
shift
done
}
parse_commandline "$@"
handle_passed_args_count
assign_positional_args 1"${_positionals[@]}"
# OTHER STUFF GENERATED BY Argbash
### END OF CODE GENERATED BY Argbash (sortof) ### ])
# [ <-- needed because of Argbash
set -e
echo$_arg_version
if[ x$_arg_version != x ];then
version=$_arg_version
else
version=$(rpm -q --specfile --qf='%{version}\n' nodejs.spec | head -n1)