cli-completion: work on the Stretch bash

git-svn-id: https://svn.fournier38.fr/svn/ProgSVN/trunk@3929 bf3deb0d-5f1a-0410-827f-c0cc1f45334c
This commit is contained in:
2017-09-05 12:02:10 +00:00
parent 314f1cf9f6
commit 7de411e6c3

View File

@@ -31,7 +31,7 @@ _cli.php()
opts="$opts opts="$opts
$LISTCLASSESSLASH $LISTCLASSESSLASH
" "
read -r LISTCLASSESLINE <<< ${LISTCLASSES} LISTCLASSESLINE=$(tr '\n' ' ' <<< ${LISTCLASSES})
if [ "$3" == "-list" ]; then if [ "$3" == "-list" ]; then
# Do not take any option # Do not take any option
COMPREPLY=() COMPREPLY=()
@@ -78,7 +78,7 @@ $LISTCLASSESSLASH
[ "${COMP_WORDS[3]+1}" != "" ]; then [ "${COMP_WORDS[3]+1}" != "" ]; then
# Class + method + first parameter available # Class + method + first parameter available
local LISTMETHODS=$($1 $EXPERT -listmethodsonly "${CLASS}") local LISTMETHODS=$($1 $EXPERT -listmethodsonly "${CLASS}")
read -r LISTMETHODSLINE <<< ${LISTMETHODS} LISTMETHODSLINE=$(tr '\n' ' ' <<< ${LISTMETHODS})
METHOD=${COMP_WORDS[2]} METHOD=${COMP_WORDS[2]}
if [[ " ${LISTCLASSESLINE} " =~ " ${CLASS} " ]] && if [[ " ${LISTCLASSESLINE} " =~ " ${CLASS} " ]] &&
[[ " ${LISTMETHODSLINE} " =~ " ${METHOD} " ]]; then [[ " ${LISTMETHODSLINE} " =~ " ${METHOD} " ]]; then