From 5d97a2c9289f0f60f4fa08cd07c2bd5753fe638c Mon Sep 17 00:00:00 2001 From: ianmacd <> Date: Wed, 23 Oct 2002 14:05:16 +0000 Subject: [PATCH] - very basic look(1) completion --- bash_completion | 18 +++++++++++++++++- 1 file changed, 17 insertions(+), 1 deletion(-) diff --git a/bash_completion b/bash_completion index b5f72aac..22f65994 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.457 2002/10/23 15:50:04 ianmacd Exp $ +# $Id: bash_completion,v 1.458 2002/10/23 16:05:16 ianmacd Exp $ # # Copyright (C) Ian Macdonald # @@ -4007,6 +4007,22 @@ _removepkg() [ $have ] && complete -F _removepkg $filenames removepkg && complete -o dirnames -f -X '!*.tgz' installpkg upgradepkg explodepkg +# look(1) completion +# +have look && +_look() +{ + local cur + + COMPREPLY=() + cur=${COMP_WORDS[COMP_CWORD]} + + if [ $COMP_CWORD = 1 ]; then + COMPREPLY=( $( compgen -W '$(look $cur)' ) ) + fi +} +[ "$have" ] && complete -F _look $default look + _filedir_xspec() { local IFS cur xspec