scripts/bash-completion: Adjustments for older Bash versions
Older versions of Bash don't handle -v option in array context very well. Also, some of the compopt options are missing in older versions so make sure stderr stays silent. Signed-off-by: Michal Berger <michal.berger@intel.com> Change-Id: I81989940e8b25e2dbeed91f97fed5aa65e7df656 Reviewed-on: https://review.spdk.io/gerrit/c/spdk/spdk/+/14130 Reviewed-by: Jim Harris <james.r.harris@intel.com> Reviewed-by: Paul Luse <paul.e.luse@intel.com> Reviewed-by: Ben Walker <benjamin.walker@intel.com> Community-CI: Broadcom CI <spdk-ci.pdl@broadcom.com> Tested-by: SPDK CI Jenkins <sys_sgci@intel.com> Reviewed-by: Krzysztof Karas <krzysztof.karas@intel.com>
This commit is contained in:
parent
49543bca68
commit
3b2eb02bc9
@ -75,7 +75,7 @@ _get_help_rpc_method() {
|
|||||||
_is_rpc_method() {
|
_is_rpc_method() {
|
||||||
local word=$1
|
local word=$1
|
||||||
|
|
||||||
[[ -v rpc_methods["$word"] ]]
|
[[ -n $word && -n ${rpc_methods["$word"]} ]]
|
||||||
}
|
}
|
||||||
|
|
||||||
_method_in_words() {
|
_method_in_words() {
|
||||||
@ -148,7 +148,7 @@ _spdk_opt_to_complete() {
|
|||||||
fi
|
fi
|
||||||
;;
|
;;
|
||||||
*) return 1 ;;
|
*) return 1 ;;
|
||||||
esac
|
esac 2> /dev/null
|
||||||
return 0
|
return 0
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -218,7 +218,7 @@ _rpc() {
|
|||||||
_filedir
|
_filedir
|
||||||
else
|
else
|
||||||
COMPREPLY=($(compgen -W '${!rpc_methods[*]}' -- "$cur"))
|
COMPREPLY=($(compgen -W '${!rpc_methods[*]}' -- "$cur"))
|
||||||
fi
|
fi 2> /dev/null
|
||||||
}
|
}
|
||||||
|
|
||||||
_spdk_app() {
|
_spdk_app() {
|
||||||
|
Loading…
Reference in New Issue
Block a user