The release script previously raised an out-of-bounds error when either
flag was supplied without an argument. Validate the next argv index
exists and surface a usage message instead.
Assisted-by: Crush:minimax-m3
@@ -54,9 +54,19 @@ while test $i -le (count $argv)
switch $argv[$i]
case --from
set i (math $i + 1)
+ if test $i -gt (count $argv)
+ echo "Error: --from requires a value" >&2
+ __release_lune_usage >&2
+ exit 1
+ end
set -g __rl_from $argv[$i]
case --only
set i (math $i + 1)
+ if test $i -gt (count $argv)
+ echo "Error: --only requires a value" >&2
+ __release_lune_usage >&2
+ exit 1
+ end
set -g __rl_only $argv[$i]
case --help -h
__release_lune_usage