backport of repo-completion for bash version 3.x, tested on 3.2.25

Using arrays instead of associative arrays, which were introduced
in bash version 4.

Change-Id: If28b54939898ac21814744bf89c6381d98784823
cherry-pick fix_inline_branch

not using google project bash-completion-lib version's of _get_cword

Change-Id: I3625c05972d062316341a5564751aa7dfc7736ff