Skip to content

Conversation

@duncan3dc
Copy link
Contributor

It is common to group commands into namespaces by using a colon in the command name to separate them.
However standard bash completion treats the colon as a wordbreak (useful for ssh/scp)
This change allows bash completion to work with commands including a colon character
Based on the answer from this stack overflow quetion:
http://stackoverflow.com/questions/10528695/how-to-reset-comp-wordbreaks-without-effecting-other-completion-script

It is common to group commands into namespaces by using a colon in the command name to separate them.
However standard bash completion treats the colon as a wordbreak (useful for ssh/scp)
This change allows bash completion to work with commands including a colon character
Based on the answer from this stack overflow quetion:
http://stackoverflow.com/questions/10528695/how-to-reset-comp-wordbreaks-without-effecting-other-completion-script
@stecman stecman merged commit c160d17 into stecman:master Jul 13, 2014
stecman added a commit that referenced this pull request Jul 13, 2014
The CompletionHandler class was handling both completion and setting up the
command/words to complete for. CompletionHandler now takes a CompletionContext
in its constructor, which provides the command and words to complete for.

Additionally:

* Replaced use of the COMP_WORDBREAKS variable with a set of break characters
  more suited to parsing Symfony console application command-lines. This was
  needed for the colon character fix from #1 to work properly, as previously
  ':' was still in COMP_WORDBREAKS so was used to split a command up.
* Added unit tests for CompletionContext
@stecman
Copy link
Owner

stecman commented Jul 13, 2014

Thanks for your contribution @duncan3dc. I've been considering refactoring this module for a while, as it was originally thrown together quite quickly. Your PR inspired me to put some more work into it!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants