Getopts's not yet implemented for other helpers.

This commit is contained in:
Maniack Crudelis 2019-01-28 01:41:40 +01:00 committed by GitHub
parent 8ffd7e87f5
commit 0e96a8f659
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -98,10 +98,10 @@ ynh_handle_getopts_args () {
if [ "$parameter" = "?" ] if [ "$parameter" = "?" ]
then then
ynh_die --message="Invalid argument: -${OPTARG:-}" ynh_die "Invalid argument: -${OPTARG:-}"
elif [ "$parameter" = ":" ] elif [ "$parameter" = ":" ]
then then
ynh_die --message="-$OPTARG parameter requires an argument." ynh_die "-$OPTARG parameter requires an argument."
else else
local shift_value=1 local shift_value=1
# Use the long option, corresponding to the short option read by getopts, as a variable # Use the long option, corresponding to the short option read by getopts, as a variable
@ -179,7 +179,7 @@ ynh_handle_getopts_args () {
# Get the option_flag from getopts_parameters, by using the option_flag according to the position of the argument. # Get the option_flag from getopts_parameters, by using the option_flag according to the position of the argument.
option_flag=${getopts_parameters:$i:1} option_flag=${getopts_parameters:$i:1}
if [ -z "$option_flag" ]; then if [ -z "$option_flag" ]; then
ynh_print_warn --message="Too many arguments ! \"${arguments[$i]}\" will be ignored." ynh_print_warn "Too many arguments ! \"${arguments[$i]}\" will be ignored."
continue continue
fi fi
# Use the long option, corresponding to the option_flag, as a variable # Use the long option, corresponding to the option_flag, as a variable