Skip to content

Commit 7b68bd1

Browse files
author
ianmacd
committed
- add _rl_enabled() to detect whether a given readline variable is on. (patch by Claudio Bley <[email protected]>)
1 parent 2a484f5 commit 7b68bd1

File tree

1 file changed

+10
-1
lines changed

1 file changed

+10
-1
lines changed

bash_completion

Lines changed: 10 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
# bash_completion - some programmable completion functions for bash 2.05b
22
#
3-
# $Id: bash_completion,v 1.727 2004/07/04 00:51:18 ianmacd Exp $
3+
# $Id: bash_completion,v 1.728 2004/07/04 00:56:08 ianmacd Exp $
44
#
55
# Copyright (C) Ian Macdonald <[email protected]>
66
#
@@ -169,6 +169,15 @@ have()
169169
#
170170
[ $UNAME != Linux ] && have gsed && alias sed=gsed
171171

172+
# This function checks whether a given readline variable
173+
# is `on'.
174+
#
175+
_rl_enabled()
176+
{
177+
bind -v | grep -q '^set[ \t][ \t]*'$1'[ \t][ \t]*on'
178+
}
179+
180+
172181
# This function performs file and directory completion. It's better than
173182
# simply using 'compgen -f', because it honours spaces in filenames.
174183
# If passed -d, it completes only on directories. If passed anything else,

0 commit comments

Comments
 (0)