- add _rl_enabled() to detect whether a given readline variable is on. (patch

by Claudio Bley <bley@CS.uni-magdeburg.de>)
This commit is contained in:
ianmacd 2004-07-03 22:56:08 +00:00
parent 2a484f5160
commit 7b68bd104f

View File

@ -1,6 +1,6 @@
# bash_completion - some programmable completion functions for bash 2.05b
#
# $Id: bash_completion,v 1.727 2004/07/04 00:51:18 ianmacd Exp $
# $Id: bash_completion,v 1.728 2004/07/04 00:56:08 ianmacd Exp $
#
# Copyright (C) Ian Macdonald <ian@caliban.org>
#
@ -169,6 +169,15 @@ have()
#
[ $UNAME != Linux ] && have gsed && alias sed=gsed
# This function checks whether a given readline variable
# is `on'.
#
_rl_enabled()
{
bind -v | grep -q '^set[ \t][ \t]*'$1'[ \t][ \t]*on'
}
# This function performs file and directory completion. It's better than
# simply using 'compgen -f', because it honours spaces in filenames.
# If passed -d, it completes only on directories. If passed anything else,