Skip to content

Augment an existing completion function with my own #1400

Answered by akinomyoga
dhalbert asked this question in Q&A
Discussion options

You must be logged in to vote

You can call the bash-completion function at the beginning of _myfunction.

# For bash-completion >= 2.12
_comp_load make
_myfunction() {
  _comp_cmd_make "$@"

  # ...

  COMPREPLY+=(...)
}
complete -F _myfunction make

# For bash-completion < 2.12
__load_completion make
_myfunction() {
  _make "$@"

  # ...

  COMPREPLY+=(...)
}
complete -F _myfunction make

Replies: 1 comment 1 reply

Comment options

You must be logged in to vote
1 reply
@dhalbert
Comment options

Answer selected by dhalbert
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
2 participants