/brz/remove-bazaar

To get this branch, use:
bzr branch http://gegoxaren.bato24.eu/bzr/brz/remove-bazaar

« back to all changes in this revision

Viewing changes to bashcomp.py

  • Committer: Martin von Gagern
  • Date: 2010-05-05 07:36:21 UTC
  • mto: (5255.4.1 bash_completion-TagNames)
  • mto: This revision was merged to the branch mainline in revision 5277.
  • Revision ID: martin.vgagern@gmx.net-20100505073621-8cdx511arxsayjcn
Ensure proper quoting of spaces in tag names.

Show diffs side-by-side

added added

removed removed

Lines of Context:
68
68
{
69
69
        local cur cmds cmdIdx cmd cmdOpts fixedWords i globalOpts
70
70
        local curOpt optEnums
71
 
        local IFS=$' \n'
 
71
        local IFS=$' \\n'
72
72
 
73
73
        COMPREPLY=()
74
74
        cur=${COMP_WORDS[COMP_CWORD]}
120
120
                ;;
121
121
        esac
122
122
 
123
 
        IFS=$'\n'
 
123
        IFS=$'\\n'
124
124
        if [[ ${#fixedWords[@]} -eq 0 ]] && [[ ${#optEnums[@]} -eq 0 ]] && [[ $cur != -* ]]; then
125
125
                case $curOpt in
126
126
                        tag:*)
127
 
                                fixedWords=( $(bzr tags 2>/dev/null | sed 's/  *[^ ]*$//') )
 
127
                                fixedWords=( $(bzr tags 2>/dev/null | sed 's/  *[^ ]*$//; s/ /\\\\\\\\ /g;') )
 
128
                                ;;
 
129
                esac
 
130
                case $cur in
 
131
                        [\\"\\']tag:*)
 
132
                                fixedWords=( $(bzr tags 2>/dev/null | sed 's/  *[^ ]*$//; s/^/tag:/') )
128
133
                                ;;
129
134
                esac
130
135
        elif [[ $cur == = ]] && [[ ${#optEnums[@]} -gt 0 ]]; then