- fix for dpkg completion (patch by Itay Ben-Yaacov <nib_maps@yahoo.com>)
This commit is contained in:
parent
85948e9a64
commit
1aad49138d
@ -1,6 +1,6 @@
|
|||||||
# bash_completion - some programmable completion functions for bash 2.05b
|
# bash_completion - some programmable completion functions for bash 2.05b
|
||||||
#
|
#
|
||||||
# $Id: bash_completion,v 1.733 2004/07/05 23:35:36 ianmacd Exp $
|
# $Id: bash_completion,v 1.734 2004/07/05 23:45:00 ianmacd Exp $
|
||||||
#
|
#
|
||||||
# Copyright (C) Ian Macdonald <ian@caliban.org>
|
# Copyright (C) Ian Macdonald <ian@caliban.org>
|
||||||
#
|
#
|
||||||
@ -3449,19 +3449,20 @@ _comp-dpkg-installed-packages()
|
|||||||
#
|
#
|
||||||
_dpkg()
|
_dpkg()
|
||||||
{
|
{
|
||||||
local cur prev
|
local cur prev i
|
||||||
|
|
||||||
COMPREPLY=()
|
COMPREPLY=()
|
||||||
cur=${COMP_WORDS[COMP_CWORD]}
|
cur=${COMP_WORDS[COMP_CWORD]}
|
||||||
prev=${COMP_WORDS[COMP_CWORD-1]}
|
prev=${COMP_WORDS[COMP_CWORD-1]}
|
||||||
|
i=$COMP_CWORD
|
||||||
|
|
||||||
_expand || return 0
|
_expand || return 0
|
||||||
|
|
||||||
# find the last option flag
|
# find the last option flag
|
||||||
if [[ $cur != -* ]]; then
|
if [[ $cur != -* ]]; then
|
||||||
while [[ $prev != -* && $COMP_CWORD != 1 ]]; do
|
while [[ $prev != -* && $i != 1 ]]; do
|
||||||
COMP_CWORD=$((COMP_CWORD-1))
|
i=$((i-1))
|
||||||
prev=${COMP_WORDS[COMP_CWORD-1]}
|
prev=${COMP_WORDS[i-1]}
|
||||||
done
|
done
|
||||||
fi
|
fi
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user