summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorTom Grennan <tgrennan@io.vyatta.com>2007-11-29 14:53:13 -0800
committerTom Grennan <tgrennan@io.vyatta.com>2007-11-29 14:53:13 -0800
commitbc0323ce21ba5a1b85fb78bc4cd50018bff4415b (patch)
treeeeb6272f4814b9f5d8e23ab432534962f475c6fc
parentb70f4dc825db34703d0fd1c0e9020695e4dd62f7 (diff)
downloadvyatta-op-bc0323ce21ba5a1b85fb78bc4cd50018bff4415b.tar.gz
vyatta-op-bc0323ce21ba5a1b85fb78bc4cd50018bff4415b.zip
should't source files within function b/c it messes variable scope
-rw-r--r--etc/bash_completion.d/10vyatta-op15
1 files changed, 8 insertions, 7 deletions
diff --git a/etc/bash_completion.d/10vyatta-op b/etc/bash_completion.d/10vyatta-op
index 7aa29a3..0651618 100644
--- a/etc/bash_completion.d/10vyatta-op
+++ b/etc/bash_completion.d/10vyatta-op
@@ -43,13 +43,6 @@ _vyatta_op_debug ()
_vyatta_op_init ()
{
- local restore_shopts=$( shopt -p nullglob | tr \\n \; )
- shopt -s nullglob
- for f in ${vyatta_datadir}/vyatta-op/functions/allowed/* ; do
- source $f
- done
- eval $restore_shopts
-
complete -F _vyatta_op_expand ''
for xd in $vyatta_op_templates/* ; do
@@ -275,6 +268,14 @@ if [ "$_OFR_CONFIGURE" == "ok" ]; then
return 0
fi
+nullglob_save=$( shopt -p nullglob )
+shopt -s nullglob
+for f in ${vyatta_datadir}/vyatta-op/functions/allowed/* ; do
+ source $f
+done
+eval $nullglob_save
+unset nullglob_save
+
_vyatta_op_init $@
### Local Variables: