[Rivet-svn] r2868 - trunk/data

blackhole at projects.hepforge.org blackhole at projects.hepforge.org
Fri Jan 7 23:23:51 GMT 2011


Author: buckley
Date: Fri Jan  7 23:23:50 2011
New Revision: 2868

Log:
Better way to work out if the _filedir function is defined

Modified:
   trunk/data/rivet-completion

Modified: trunk/data/rivet-completion
==============================================================================
--- trunk/data/rivet-completion	Fri Jan  7 22:51:56 2011	(r2867)
+++ trunk/data/rivet-completion	Fri Jan  7 23:23:50 2011	(r2868)
@@ -1,9 +1,9 @@
 ## -*- sh -*-
 ## Analysis name completion for rivet scripts
 
-_filedir &> /dev/null
-test "$?" -eq 0 || function _filedir() {
-	local cur prev commands options command
+(type _filedir &> /dev/null) || \
+function _filedir() {
+    local cur prev commands options command
     cur="${COMP_WORDS[COMP_CWORD]}"
     COMPREPLY=( $(compgen -W "$(ls ${cur}* 2> /dev/null)" -- ${cur}) )
     return 0
@@ -11,8 +11,8 @@
 
 
 function _rivet() {
-	local cur prev commands options command
-	COMPREPLY=()
+    local cur prev commands options command
+    COMPREPLY=()
     cur="${COMP_WORDS[COMP_CWORD]}"
     prev="${COMP_WORDS[COMP_CWORD-1]}"
 
@@ -63,9 +63,9 @@
 
 
 function _rivet_config() {
-	local cur prev commands options command
-	COMPREPLY=()
-	#cur=`_get_cword`
+    local cur prev commands options command
+    COMPREPLY=()
+    #cur=`_get_cword`
     cur="${COMP_WORDS[COMP_CWORD]}"
     prev="${COMP_WORDS[COMP_CWORD-1]}"
 
@@ -96,9 +96,9 @@
 
 
 function _compare_histos() {
-	local cur prev commands options command
-	COMPREPLY=()
-	#cur=`_get_cword`
+    local cur prev commands options command
+    COMPREPLY=()
+    #cur=`_get_cword`
     cur="${COMP_WORDS[COMP_CWORD]}"
     prev="${COMP_WORDS[COMP_CWORD-1]}"
 
@@ -140,9 +140,9 @@
 
 
 function _make_plots() {
-	local cur prev commands options command
-	COMPREPLY=()
-	#cur=`_get_cword`
+    local cur prev commands options command
+    COMPREPLY=()
+    #cur=`_get_cword`
     cur="${COMP_WORDS[COMP_CWORD]}"
     prev="${COMP_WORDS[COMP_CWORD-1]}"
 
@@ -172,9 +172,9 @@
 
 
 function _aida2flat() {
-	local cur prev commands options command
-	COMPREPLY=()
-	#cur=`_get_cword`
+    local cur prev commands options command
+    COMPREPLY=()
+    #cur=`_get_cword`
     cur="${COMP_WORDS[COMP_CWORD]}"
     prev="${COMP_WORDS[COMP_CWORD-1]}"
 
@@ -210,9 +210,9 @@
 
 
 function _flat2aida() {
-	local cur prev commands options command
-	COMPREPLY=()
-	#cur=`_get_cword`
+    local cur prev commands options command
+    COMPREPLY=()
+    #cur=`_get_cword`
     cur="${COMP_WORDS[COMP_CWORD]}"
     prev="${COMP_WORDS[COMP_CWORD-1]}"
 


More information about the Rivet-svn mailing list