$COMP_CWORD
–
Index of Completed Word
$COMP_CWORD
is the index of the word in $COMP_WORDS
, which contains the cursor position.
This variable is only available in functions invoked by the programmable completion.
Links
BashSupport Pro 是一个 支持 $COMP_CWORD 的 Bash 集成开发工具 – 马上试用!