|
[Rivet-svn] r2783 - in trunk: . datablackhole at projects.hepforge.org blackhole at projects.hepforge.orgSat Nov 27 00:57:38 GMT 2010
Author: buckley Date: Sat Nov 27 00:57:37 2010 New Revision: 2783 Log: Adding programmable completion for aida2flat and flat2aida. Modified: trunk/ChangeLog trunk/data/rivet-completion Modified: trunk/ChangeLog ============================================================================== --- trunk/ChangeLog Sat Nov 27 00:49:40 2010 (r2782) +++ trunk/ChangeLog Sat Nov 27 00:57:37 2010 (r2783) @@ -1,7 +1,9 @@ 2010-11-27 Andy Buckley <andy at insectnation.org> + * Adding programmable completion for aida2flat and flat2aida. + * Improvements to programmable completion using the neat _filedir - completoin shell function which I just discovered. + completion shell function which I just discovered. 2010-11-26 Andy Buckley <andy at insectnation.org> Modified: trunk/data/rivet-completion ============================================================================== --- trunk/data/rivet-completion Sat Nov 27 00:49:40 2010 (r2782) +++ trunk/data/rivet-completion Sat Nov 27 00:57:37 2010 (r2783) @@ -145,3 +145,69 @@ complete -F _make_plots -o default make-plots + + +############################## + + +function _aida2flat() { + local cur prev commands options command + COMPREPLY=() + #cur=`_get_cword` + cur="${COMP_WORDS[COMP_CWORD]}" + prev="${COMP_WORDS[COMP_CWORD-1]}" + + opts="--help -h" + opts="$opts --split -s" + opts="$opts --gnuplot -g" + opts="$opts --plotinfodir" + opts="$opts --smart-output -S" + opts="$opts --match -m" + opts="$opts --quiet -q --verbose -v" + + if [[ ${cur} == "--plotinfodir" ]] ; then + _filedir -d + return 0 + fi + + if [[ ${cur} == -* ]] ; then + COMPREPLY=( $(compgen -W "${opts}" -- ${cur}) ) + if test -n "$COMPREPLY"; then + return 0 + fi + fi + + _filedir aida + return 0 +} + + +complete -F _aida2flat -o default aida2flat + + +############################## + + +function _flat2aida() { + local cur prev commands options command + COMPREPLY=() + #cur=`_get_cword` + cur="${COMP_WORDS[COMP_CWORD]}" + prev="${COMP_WORDS[COMP_CWORD-1]}" + + opts="--help -h" + opts="$opts --split -s" + + if [[ ${cur} == -* ]] ; then + COMPREPLY=( $(compgen -W "${opts}" -- ${cur}) ) + if test -n "$COMPREPLY"; then + return 0 + fi + fi + + _filedir dat + return 0 +} + + +complete -F _aida2flat -o default aida2flat
More information about the Rivet-svn mailing list |