[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [Monotone-devel] Tiny improvements to bash_completion
From: |
Richard Levitte - VMS Whacker |
Subject: |
Re: [Monotone-devel] Tiny improvements to bash_completion |
Date: |
Mon, 12 Mar 2007 12:28:25 +0100 (CET) |
In message <address@hidden> on Mon, 12 Mar 2007 10:04:50 +0000, Matthew Sackman
<address@hidden> said:
matthew> On Mon, Mar 12, 2007 at 09:42:17AM +0100, Olivier Andrieu wrote:
matthew> > On 3/8/07, Matthew Sackman <address@hidden> wrote:
matthew> > >shopt extglob seems to be on by default on my debian
matthew> > >systems hence why I voted make use of it ;-)
matthew> >
matthew> > indeed, that's the reason. It's off by default on Fedora
matthew> > systems.
matthew>
matthew> Eek. I didn't know that. I'm slightly amazed no other
matthew> completions need it. Mmmm what to do? Presumeably I shouldn't
matthew> turn it on from within the bash script, or should I turn it
matthew> on and then restore it to its previous state? What's the
matthew> general consensus?
Turn it on and restore, like this:
#
# old_revision [fd9f0290c217ed5b9348b84f04f569b65a6150f7]
#
# patch "contrib/monotone.bash_completion"
# from [bc2e4ffa750d87bc2cd9bcdd863250bd60999aeb]
# to [5a05c33c751f141279949c9572cdfdddf81048af]
#
============================================================
--- contrib/monotone.bash_completion bc2e4ffa750d87bc2cd9bcdd863250bd60999aeb
+++ contrib/monotone.bash_completion 5a05c33c751f141279949c9572cdfdddf81048af
@@ -22,6 +22,12 @@ fi
}
fi
+_monotone_disable_extglob=/bin/false
+if shopt -q extglob; then :; else
+ shopt -s extglob
+ _monotone_disable_extglob=/bin/true
+fi
+
# Call monotone to complete IDs
_monotone_complete() {
if (( "${#cur}" >=2 )) ; then
@@ -291,4 +297,9 @@ _monotone() {
return 0
}
+_monotone_disable_extglob=/bin/false
+if $_monotone_disable_extglob; then :; else
+ shopt -u extglob
+fi
+
complete -F _monotone -o filenames mtn
Cheers,
Richard
-----
Please consider sponsoring my work on free software.
See http://www.free.lp.se/sponsoring.html for details.
--
Richard Levitte address@hidden
http://richard.levitte.org/
"When I became a man I put away childish things, including
the fear of childishness and the desire to be very grown up."
-- C.S. Lewis