From 55f9da95c54b415d0c3514a4321d3a2fb09b7016 Mon Sep 17 00:00:00 2001 From: ianmacd <> Date: Fri, 1 Mar 2002 22:41:42 +0000 Subject: [PATCH] - _longopt(): make vague attempt at path completion after the '=' in --long-opt= options - _filedir(): don't bother to set $cur, since every function that calls it will have already set it --- bash_completion | 19 +++++++++++++------ 1 file changed, 13 insertions(+), 6 deletions(-) diff --git a/bash_completion b/bash_completion index ff6e3cb9..5d25bcbd 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.172 2002/03/01 19:29:34 ianmacd Exp $ +# $Id: bash_completion,v 1.173 2002/03/01 23:41:42 ianmacd Exp $ # # Copyright (C) Ian Macdonald # @@ -1891,12 +1891,22 @@ _psql() _longopt() { - local cur + local cur opt cur=${COMP_WORDS[COMP_CWORD]} _expand || return 0 + if [[ "$cur" == --*=* ]]; then + opt=${cur%%=*} + # cut backlash that gets inserted before '=' sign + opt=${opt%\\*} + cur=${cur#*=} + _filedir + COMPREPLY=( $( compgen -P "$opt=" -W '${COMPREPLY[@]}' -- $cur)) + return 0 + fi + if [[ "$cur" == -* ]]; then COMPREPLY=( $( $1 --help | sed -e '/--/!d' \ -e 's/.*\(--[-A-Za-z0-9]\+=\?\).*/\1/' | \ @@ -2122,10 +2132,7 @@ complete -F _configure_func configure _filedir() { - local IFS cur - - IFS=$'\t\n' - cur=${COMP_WORDS[COMP_CWORD]} + local IFS=$'\t\n' _expand || return 0