From a1b836f52685e6cfb99f91d9b35e07bc99cde176 Mon Sep 17 00:00:00 2001 From: ianmacd <> Date: Mon, 18 Feb 2002 08:39:02 +0000 Subject: [PATCH] _configure_func() now calls _longopt(), rather than duplicating code --- bash_completion | 20 +++++++++----------- 1 file changed, 9 insertions(+), 11 deletions(-) diff --git a/bash_completion b/bash_completion index e4426f0e..18584e8a 100644 --- a/bash_completion +++ b/bash_completion @@ -1,6 +1,6 @@ # bash_completion - some programmable completion functions for bash 2.05a # -# $Id: bash_completion,v 1.124 2002/02/18 09:32:56 ianmacd Exp $ +# $Id: bash_completion,v 1.125 2002/02/18 09:39:02 ianmacd Exp $ # # Copyright (C) Ian Macdonald # @@ -1777,7 +1777,7 @@ _gcc() { local cur cc cmd backend - COMREPLY=() + COMPREPLY=() cur=${COMP_WORDS[COMP_CWORD]} [[ "$cur" != -* ]] && return 0 @@ -1880,17 +1880,15 @@ _expand() fi } -_configure_func () +_configure_func() { - case "$2" in - -*) ;; - *) return ;; - esac + local cur - case "$1" in - \~*) eval cmd=$1 ;; - *) cmd="$1" ;; - esac + COMPREPLY=() + cur=${COMP_WORDS[COMP_CWORD]} + + [[ "$cur" != -* ]] && return 0 + _longopt "$1" "$cur" "" no_completion COMPREPLY=( $( "$cmd" --help | sed -ne 's/^ *\('$2'[^ '$'\t'',[]\+\).*$/\1/p' ) ) }