from __future__ import absolute_import
from pip.basecommand import Command
# pip %(shell)s completion start%(script)s# pip %(shell)s completion end
COMPREPLY=( $( COMP_WORDS="${COMP_WORDS[*]}" \\
COMP_CWORD=$COMP_CWORD \\
PIP_AUTO_COMPLETE=1 $1 ) )
complete -o default -F _pip_completion pip
function _pip_completion {
reply=( $( COMP_WORDS="$words[*]" \\
COMP_CWORD=$(( cword-1 )) \\
PIP_AUTO_COMPLETE=1 $words[1] ) )
compctl -K _pip_completion pip
class CompletionCommand(Command):
"""A helper command to be used for command completion."""
summary = 'A helper command used for command completion'
def __init__(self, *args, **kw):
super(CompletionCommand, self).__init__(*args, **kw)