[cig-commits] r14069 - cs/cigma/trunk
luis at geodynamics.org
luis at geodynamics.org
Wed Feb 18 08:14:11 PST 2009
Author: luis
Date: 2009-02-18 08:14:11 -0800 (Wed, 18 Feb 2009)
New Revision: 14069
Added:
cs/cigma/trunk/bash_completion.sh
Removed:
cs/cigma/trunk/completion.sh
Log:
Rename completion script to emphasize it only works on bash.
Implementing this functionality in other shells should be relatively easy.
Copied: cs/cigma/trunk/bash_completion.sh (from rev 14068, cs/cigma/trunk/completion.sh)
===================================================================
--- cs/cigma/trunk/bash_completion.sh (rev 0)
+++ cs/cigma/trunk/bash_completion.sh 2009-02-18 16:14:11 UTC (rev 14069)
@@ -0,0 +1,32 @@
+#!/bin/bash
+
+#
+# Based on darcs bash completion
+#
+_cigma()
+{
+ local cur
+
+ cur=${COMP_WORDS[COMP_CWORD]}
+
+ COMPREPLY=()
+
+ if (($COMP_CWORD == 1)); then
+ COMPREPLY=( $( cigma --commands | grep "^$cur" ) )
+ return 0
+ fi
+
+ local IFS=$'\n'
+ COMPREPLY=( $( cigma ${COMP_WORDS[1]} --list-options | grep "^${cur//./\\.}") )
+
+ local i=${#COMPREPLY[*]}
+ local colonprefixes=${cur%"${cur##*:}"}
+ while [ $((--i)) -ge 0 ]; do
+ COMPREPLY[$i]=`printf %q "${COMPREPLY[$i]}"`
+ COMPREPLY[$i]=${COMPREPLY[$i]#"$colonprefixes"}
+ done
+ return 0
+
+}
+complete -F _cigma -o default cigma
+
Deleted: cs/cigma/trunk/completion.sh
===================================================================
--- cs/cigma/trunk/completion.sh 2009-02-18 16:14:09 UTC (rev 14068)
+++ cs/cigma/trunk/completion.sh 2009-02-18 16:14:11 UTC (rev 14069)
@@ -1,32 +0,0 @@
-#!/bin/bash
-
-#
-# Based on darcs bash completion
-#
-_cigma()
-{
- local cur
-
- cur=${COMP_WORDS[COMP_CWORD]}
-
- COMPREPLY=()
-
- if (($COMP_CWORD == 1)); then
- COMPREPLY=( $( cigma --commands | grep "^$cur" ) )
- return 0
- fi
-
- local IFS=$'\n'
- COMPREPLY=( $( cigma ${COMP_WORDS[1]} --list-options | grep "^${cur//./\\.}") )
-
- local i=${#COMPREPLY[*]}
- local colonprefixes=${cur%"${cur##*:}"}
- while [ $((--i)) -ge 0 ]; do
- COMPREPLY[$i]=`printf %q "${COMPREPLY[$i]}"`
- COMPREPLY[$i]=${COMPREPLY[$i]#"$colonprefixes"}
- done
- return 0
-
-}
-complete -F _cigma -o default cigma
-
More information about the CIG-COMMITS
mailing list