From 30c8eb9a738a958aa34b3fb7aa40a6acc31cf82f Mon Sep 17 00:00:00 2001 From: ianmacd <> Date: Wed, 31 Dec 2003 23:58:30 +0000 Subject: [PATCH] - Postfix completion enhancement by Michael G --- bash_completion | 19 ++++++++++++++++++- 1 file changed, 18 insertions(+), 1 deletion(-) diff --git a/bash_completion b/bash_completion index 63a0c896..f9c92c5a 100644 --- a/bash_completion +++ b/bash_completion @@ -1,6 +1,6 @@ # bash_completion - some programmable completion functions for bash 2.05b # -# $Id: bash_completion,v 1.669 2004/01/01 00:51:46 ianmacd Exp $ +# $Id: bash_completion,v 1.670 2004/01/01 00:58:30 ianmacd Exp $ # # Copyright (C) Ian Macdonald # @@ -999,6 +999,23 @@ have postfix && { # _postfix() { + local cur prev + + cur=${COMP_WORDS[COMP_CWORD]} + prev=${COMP_WORDS[COMP_CWORD-1]} + + if [[ $cur == '-' ]]; then + COMPREPLY=(-c -D -v) + return 0 + fi + if [[ $prev == '-c' ]]; then + _filedir -d + return 0 + fi + if [[ $prev == '-D' ]]; then + COMPREPLY=( $( compgen -W 'start' -- "${COMP_WORDS[COMP_CWORD]}" ) ) + return 0 + fi COMPREPLY=( $( compgen -W 'start stop reload abort flush check' -- \ "${COMP_WORDS[COMP_CWORD]}" ) ) }