[Rivet-svn] r4071 - branches/2012-06-aidarivet/data

blackhole at projects.hepforge.org blackhole at projects.hepforge.org
Fri Dec 7 18:20:10 GMT 2012


Author: buckley
Date: Fri Dec  7 18:20:10 2012
New Revision: 4071

Log:
Fix in rivet-completion -- the egrep start-of-word pattern seems to have changed behaviour where - signs (i.e. \<--analysis\> or --\<analysis\>) are concerned, making the handy completion stop working, at least on my Ubuntu 12.10 machine

Modified:
   branches/2012-06-aidarivet/data/rivet-completion

Modified: branches/2012-06-aidarivet/data/rivet-completion
==============================================================================
--- branches/2012-06-aidarivet/data/rivet-completion	Fri Dec  7 18:18:16 2012	(r4070)
+++ branches/2012-06-aidarivet/data/rivet-completion	Fri Dec  7 18:20:10 2012	(r4071)
@@ -28,25 +28,23 @@
         fi
     fi
 
-    if test -x "$(which rivet 2> /dev/null)"; then
-        anas=$(rivet --list-analyses)
-        if (echo ${prev} | egrep -- "\<-a\>|\<--analysis\>|\<--show-analysis\>|\<--list-analyses\>" &> /dev/null); then
-            COMPREPLY=( $(compgen -W "$anas" -- ${cur}) )
-            return 0
-        fi
+    if (echo ${prev} | egrep -- "-\<a\>|--\<analysis\>|--\<show-analysis\>|--\<list-analyses\>" &> /dev/null); then
+        anas=$(rivet --list-analyses --quiet)
+        COMPREPLY=( $(compgen -W "$anas" -- ${cur}) )
+        return 0
     fi
 
-    if (echo ${prev} | egrep -- "\<-n\>|\<--nevts\>|\<--runname\>|\<--histo-interval\>|\<--cross-section\>|\<-x\>|\<--event-timeout\>" &> /dev/null); then
+    if (echo ${prev} | egrep -- "\<-n\>|--\<nevts\>|--\<runname\>|--\<histo-interval\>|--\<cross-section\>|\<-x\>|--\<event-timeout\>" &> /dev/null); then
         COMPREPLY=()
         return 0
     fi
 
-    if (echo ${prev} | egrep -- "\<--histo-file\>|\<-H\>" &> /dev/null); then
+    if (echo ${prev} | egrep -- "--\<histo-file\>|\<-H\>" &> /dev/null); then
         _filedir aida
         return 0
     fi
 
-    if (echo ${prev} | egrep -- "\<--analysis-path\>|\<--analysis-path-append\>" &> /dev/null); then
+    if (echo ${prev} | egrep -- "--\<analysis-path\>|--\<analysis-path-append\>" &> /dev/null); then
         _filedir -d
         return 0
     fi
@@ -196,17 +194,17 @@
     fi
 
     ## Options with files / directories as the arg
-    if (echo ${prev} | egrep -- "\<--outputdir\>|\<-o\>" &> /dev/null); then
+    if (echo ${prev} | egrep -- "--\<outputdir\>|\<-o\>" &> /dev/null); then
         _filedir -d
         return 0
     fi
-    if (echo ${prev} | egrep -- "\<--config\>|\<-c\>" &> /dev/null); then
+    if (echo ${prev} | egrep -- "--\<config\>|\<-c\>" &> /dev/null); then
         _filedir
         return 0
     fi
 
     ## Options without an completeable arg
-    if (echo ${prev} | egrep -- "\<-t\>|\<--title\>|\<--refid\>|\<--n\>|\<--num-threads\>|\<-m\>|\<--match\>|\<-M\>|\<--unmatch\>" &> /dev/null); then
+    if (echo ${prev} | egrep -- "\<-t\>|--\<title\>|--\<refid\>|--\<n\>|--\<num-threads\>|\<-m\>|--\<match\>|\<-M\>|--\<unmatch\>" &> /dev/null); then
         COMPREPLY=()
         return 0
     fi


More information about the Rivet-svn mailing list