Shell completion export from the wrapper binary
[alexxy/gromacs.git] / scripts / GMXRC.bash.cmakein
index 3bd1674d6d389cbf27a470982e17cf550392014b..a7a1a0c22b7ccd4575535055d435bc079d16b333 100644 (file)
@@ -72,13 +72,19 @@ unset old_IFS
 # and this shell supports extended globbing
 if test -n "${BASH_VERSION+set}" && (complete) > /dev/null 2>&1; then
   if (shopt -s extglob) > /dev/null 2>&1; then
-    if [ -f $GMXBIN/completion.bash ]; then
-      source $GMXBIN/completion.bash; 
+    if [ -f $GMXBIN/gmx-completion.bash ]; then
+      source $GMXBIN/gmx-completion.bash
+      for cfile in $GMXBIN/gmx-completion-*.bash ; do
+        source $cfile
+      done
     fi
   fi
 # read zsh completions if understand how to use them
-elif test -n "${ZSH_VERSION+set}" && compctl >& /dev/null; then
-  if [ -f $GMXBIN/completion.zsh ]; then
-    source $GMXBIN/completion.zsh; 
-  fi
+# Currently disabled, since the completions don't work with the new
+# gmx binary with subcommands.
+# Contributions to get the functionality back are welcome.
+#elif test -n "${ZSH_VERSION+set}" && compctl >& /dev/null; then
+#  if [ -f $GMXBIN/gmx-completion.zsh ]; then
+#    source $GMXBIN/gmx-completion.zsh;
+#  fi
 fi