[Bash-completion-devel] contrib/modules
Ted Stern
lgtedstern at gmail.com
Mon Oct 19 17:40:43 UTC 2009
I have one small change for the contrib/modules completion. It turns
out that configuring a .version file in Environment Modules to set a
default module can cause "(default)" to appear in the module name when
using the 'module avail' command. But this is bad for completion.
So here is one attempt at a modification to filter out "(default)".
diff -u modules.orig modules
--- modules.orig 2009-10-09 05:49:31.000000000 -0700
+++ modules 2009-10-19 10:35:51.000000000 -0700
@@ -35,7 +35,9 @@
local modules="$( \
module avail 2>&1 | \
egrep -v '^(-|$)' | \
- xargs printf '%s\n' | sort )"
+ xargs printf '%s\n' | \
+ sed -e 's/(default)//g' | \
+ sort )"
compgen -W "$modules" -- $1
}
BTW, I have not been "stern at cray.com" for 4 years.
Ted
--
Frango ut patefaciam -- I break so that I may reveal
More information about the Bash-completion-devel
mailing list