Fix completion if word-to-complete contains colon (:) #9

Merged
merged 1 commit into from Sep 19, 2012
Commits on Sep 19, 2012
  1. Fix completion if word-to-complete contains colon (:)

    miezuit committed Sep 19, 2012
    The recommended way to handle colons in completion words
    is by using the helper methods:
     * _get_comp_words_by_ref with the -n : option
          gets the word-to-complete without considering a colon as a word break
     * __ltrim_colon_completions
          removes colon containing prefix from COMPREPLY items
          (a workaround for http://tiswww.case.edu/php/chet/bash/FAQ - E13)
    
    Using the helper methods also simplifies the script and
    ensures that we get the same behavior on any environment.