- _kill(): call _pids rather than duplicate code

- _longopt(): when parsing --help output, pipe stderr through stdout
This commit is contained in:
ianmacd 2002-04-02 06:22:27 +00:00
parent f91a652220
commit c1c7ae5797

View File

@ -1,6 +1,6 @@
# bash_completion - some programmable completion functions for bash 2.05a # bash_completion - some programmable completion functions for bash 2.05a
# #
# $Id: bash_completion,v 1.244 2002/04/02 08:17:35 ianmacd Exp $ # $Id: bash_completion,v 1.245 2002/04/02 08:22:27 ianmacd Exp $
# #
# Copyright (C) Ian Macdonald <ian@caliban.org> # Copyright (C) Ian Macdonald <ian@caliban.org>
# #
@ -507,7 +507,7 @@ _kill()
_signals _signals
else else
# return list of available PIDs # return list of available PIDs
COMPREPLY=( $( \ls /proc | grep '^[0-9]\+'| grep ^$cur ) ) _pids
fi fi
} }
complete -F _kill kill complete -F _kill kill
@ -2092,7 +2092,7 @@ _longopt()
fi fi
if [[ "$cur" == -* ]]; then if [[ "$cur" == -* ]]; then
COMPREPLY=( $( $1 --help | sed -e '/--/!d' \ COMPREPLY=( $( $1 --help 2>&1 | sed -e '/--/!d' \
-e 's/.*\(--[-A-Za-z0-9]\+=\?\).*/\1/' | \ -e 's/.*\(--[-A-Za-z0-9]\+=\?\).*/\1/' | \
grep ^$cur | sort -u ) ) grep ^$cur | sort -u ) )
elif [[ "$1" == @(mk|rm)dir ]]; then elif [[ "$1" == @(mk|rm)dir ]]; then