Changeset 81


Ignore:
Timestamp:
04/15/2006 20:20:35 (6 years ago)
Author:
yontege
Message:

The completion function is not tolerating 'source' or 'eval' while
trying to get RECIPE_PATH from the confman.conf file.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • confman/bash_completions

    r80 r81  
    66        CONFMAN_CONF="/usr/local/rescomp/etc/confman.conf" 
    77        CONFMAN_RC="~/.confmanrc" 
    8         [ -e ${CONFMAN_CONF} ] && source ${CONFMAN_CONF} 
    9         [ -e ${CONFMAN_RC} ] && source ${CONFMAN_RC} 
     8        if [ -e ${CONFMAN_CONF} ] ; then 
     9                RECIPE_PATH=$(grep '^RECIPE_PATH' ${CONFMAN_CONF}|cut -d'"' -f2) 
     10        elif [ -e ${CONFMAN_RC} ] ; then 
     11                RECIPE_PATH=$(grep '^RECIPE_PATH' ${CONFMAN_RC}|cut -d'"' -f2) 
     12        fi 
    1013        COMPREPLY=() 
    1114        cur="${COMP_WORDS[COMP_CWORD]}" 
     
    3740            return 0 
    3841        elif [ `expr "${mod_cmds}" : ".*\(${prev}\).*"` ] ; then 
    39                 local modules=$(grep -vE '^#|^$' ${RECIPE_PATH} | tr '\n' ' ') 
     42                local modules=$(grep -vE '^#|^$' $RECIPE_PATH | tr '\n' ' ') 
    4043                COMPREPLY=($(compgen -W "${modules}" -- ${cur})) 
    4144                return 0 
Note: See TracChangeset for help on using the changeset viewer.