Konubinix' opinionated web of thoughts

$COMP_CWORD and $COMP_WORDS

Fleeting

bash bash-completion

$COMP_CWORD is the index of the word in $COMP_WORDS, which contains the cursor position

https://www.bashsupport.com/bash/variables/bash/comp_cword/