mirror of
https://github.com/containers/skopeo.git
synced 2025-08-30 21:25:11 +00:00
completions: Fix bash completions when a option requires a argument
Since the string of options variable as pattern in the case statement has not been delimited and it does not match the value of prev variable, bash completions tries to complement any option even when a specified option requires a argument. This fix stops complementing options when a option requires a argument. Signed-off-by: ERAMOTO Masaya <eramoto.masaya@jp.fujitsu.com>
This commit is contained in:
parent
42b01df89e
commit
790620024e
@ -6,11 +6,14 @@ _complete_() {
|
||||
local options_with_args=$1
|
||||
local boolean_options="$2 -h --help"
|
||||
|
||||
case "$prev" in
|
||||
$options_with_args)
|
||||
return
|
||||
;;
|
||||
esac
|
||||
local option_with_args
|
||||
for option_with_args in $options_with_args
|
||||
do
|
||||
if [ "$option_with_args" == "$prev" ]
|
||||
then
|
||||
return
|
||||
fi
|
||||
done
|
||||
|
||||
case "$cur" in
|
||||
-*)
|
||||
|
Loading…
Reference in New Issue
Block a user