- _make(): add long option completion
- cleaned up _configure(), _longopt() and _gcc()
This commit is contained in:
parent
0f4d4d3dd4
commit
c6602afe92
@ -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.155 2002/02/27 02:02:43 ianmacd Exp $
|
# $Id: bash_completion,v 1.156 2002/02/27 02:18:08 ianmacd Exp $
|
||||||
#
|
#
|
||||||
# Copyright (C) Ian Macdonald <ian@caliban.org>
|
# Copyright (C) Ian Macdonald <ian@caliban.org>
|
||||||
#
|
#
|
||||||
@ -1157,10 +1157,16 @@ _make()
|
|||||||
return 0
|
return 0
|
||||||
fi
|
fi
|
||||||
|
|
||||||
|
# check for a long option
|
||||||
|
if [[ "$cur" == --* ]]; then
|
||||||
|
_longopt $1
|
||||||
|
return 0
|
||||||
|
fi
|
||||||
|
|
||||||
# if we want an option, return the possible posix options
|
# if we want an option, return the possible posix options
|
||||||
if [[ "$cur" == -* ]]; then
|
if [[ "$cur" == -* ]]; then
|
||||||
COMPREPLY=( $( compgen -W '-e -f -i -k -n -p -q -r -S -s -t' -- \
|
COMPREPLY=( $( compgen -W '-e -f -i -k -n -p -q -r -S -s -t' \
|
||||||
$cur ) )
|
-- $cur ) )
|
||||||
return 0
|
return 0
|
||||||
fi
|
fi
|
||||||
|
|
||||||
@ -1720,8 +1726,6 @@ _longopt()
|
|||||||
|
|
||||||
_expand || return 0
|
_expand || return 0
|
||||||
|
|
||||||
[ "$4" = no_completion ] && return 0
|
|
||||||
|
|
||||||
if [[ "$cur" == -* ]]; then
|
if [[ "$cur" == -* ]]; then
|
||||||
COMPREPLY=( $( $1 --help | sed -e '/--/!d' \
|
COMPREPLY=( $( $1 --help | sed -e '/--/!d' \
|
||||||
-e 's/.*\(--[-A-Za-z0-9]\+=\?\).*/\1/' | \
|
-e 's/.*\(--[-A-Za-z0-9]\+=\?\).*/\1/' | \
|
||||||
@ -1761,10 +1765,7 @@ _gcc()
|
|||||||
COMPREPLY=()
|
COMPREPLY=()
|
||||||
cur=${COMP_WORDS[COMP_CWORD]}
|
cur=${COMP_WORDS[COMP_CWORD]}
|
||||||
|
|
||||||
_longopt "$1" "$cur" "" no_completion
|
_expand || return 0
|
||||||
|
|
||||||
# return if _expand returned anything
|
|
||||||
[ ${#COMPREPLY[@]} -gt 0 ] && return 0
|
|
||||||
|
|
||||||
case "$1" in
|
case "$1" in
|
||||||
gcj)
|
gcj)
|
||||||
@ -1777,7 +1778,7 @@ _gcc()
|
|||||||
backend=f771
|
backend=f771
|
||||||
;;
|
;;
|
||||||
*)
|
*)
|
||||||
backend=cc1 # [near-]universal backend
|
backend=cc1 # (near-)universal backend
|
||||||
;;
|
;;
|
||||||
esac
|
esac
|
||||||
|
|
||||||
@ -1892,7 +1893,6 @@ _configure_func()
|
|||||||
cur=${COMP_WORDS[COMP_CWORD]}
|
cur=${COMP_WORDS[COMP_CWORD]}
|
||||||
|
|
||||||
[[ "$cur" != -* ]] && return 0
|
[[ "$cur" != -* ]] && return 0
|
||||||
_longopt "$1" "$cur" "" no_completion
|
|
||||||
|
|
||||||
COMPREPLY=( $( $1 --help | sed -ne 's/^ *\('$cur'[^ '$'\t'',[]\+\).*$/\1/p' ) )
|
COMPREPLY=( $( $1 --help | sed -ne 's/^ *\('$cur'[^ '$'\t'',[]\+\).*$/\1/p' ) )
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user