2000-05-15 15:19:26 +02:00
|
|
|
#compdef -vared-
|
|
|
|
|
|
|
|
local also
|
|
|
|
|
|
|
|
# Completion inside vared.
|
|
|
|
|
|
|
|
if [[ $compstate[vared] = *\[* ]]; then
|
2000-05-25 09:58:44 +02:00
|
|
|
if [[ $compstate[vared] = *\]* ]]; then
|
|
|
|
# vared on an array-element
|
|
|
|
compstate[parameter]=${${compstate[vared]%%\]*}//\[/-}
|
|
|
|
compstate[context]=value
|
|
|
|
also=-value-
|
|
|
|
else
|
|
|
|
# vared on an array-value
|
|
|
|
compstate[parameter]=${compstate[vared]%%\[*}
|
|
|
|
compstate[context]=value
|
|
|
|
also=-value-
|
|
|
|
fi
|
2000-05-15 15:19:26 +02:00
|
|
|
else
|
|
|
|
# vared on a parameter, let's see if it is an array
|
|
|
|
compstate[parameter]=$compstate[vared]
|
|
|
|
if [[ ${(tP)compstate[vared]} = *(array|assoc)* ]]; then
|
|
|
|
compstate[context]=array_value
|
|
|
|
also=-array-value-
|
|
|
|
else
|
|
|
|
compstate[context]=value
|
|
|
|
also=-value-
|
|
|
|
fi
|
|
|
|
fi
|
|
|
|
|
|
|
|
# Don't insert TAB in first column. Never.
|
|
|
|
|
|
|
|
compstate[insert]="${compstate[insert]//tab /}"
|
|
|
|
|
|
|
|
_compalso "$also"
|