mirror of
https://github.com/YunoHost/yunohost.git
synced 2024-09-03 20:06:10 +02:00
detect wrong arguments
This commit is contained in:
parent
15a7967f47
commit
6945867f86
1 changed files with 6 additions and 0 deletions
|
@ -130,6 +130,12 @@ ynh_handle_getopts_args () {
|
|||
then
|
||||
# Remove the option and the space, so keep only the value itself.
|
||||
all_args[0]="${all_args[0]#-${parameter} }"
|
||||
|
||||
# At this point, if all_args[0] start with "-", then the argument is not well formed
|
||||
if [ "${all_args[0]:0:1}" == "-" ]
|
||||
then
|
||||
ynh_die --message="Argument \"${all_args[0]}\" not valid! Did you use a single \"-\" instead of two?"
|
||||
fi
|
||||
# Reduce the value of shift, because the option has been removed manually
|
||||
shift_value=$(( shift_value - 1 ))
|
||||
fi
|
||||
|
|
Loading…
Add table
Reference in a new issue