diff options
author | Ciaran McCreesh <ciaranm@gentoo.org> | 2005-05-09 00:02:32 +0000 |
---|---|---|
committer | Ciaran McCreesh <ciaranm@gentoo.org> | 2005-05-09 00:02:32 +0000 |
commit | 92a5315914bb6e022b4110fa495c7820bb8410f4 (patch) | |
tree | 0bb724488ace4342ea1bd8ecdb1df8057a274f10 /bin | |
parent | no foreign. (diff) | |
parent | updated config module (diff) | |
download | eselect-92a5315914bb6e022b4110fa495c7820bb8410f4.tar.gz eselect-92a5315914bb6e022b4110fa495c7820bb8410f4.tar.bz2 eselect-92a5315914bb6e022b4110fa495c7820bb8410f4.zip |
merge from branches/ciaranm/config
svn path=/trunk/; revision=81
Diffstat (limited to 'bin')
-rwxr-xr-x | bin/eclectic.in | 31 |
1 files changed, 24 insertions, 7 deletions
diff --git a/bin/eclectic.in b/bin/eclectic.in index cccb6d3..3f1129b 100755 --- a/bin/eclectic.in +++ b/bin/eclectic.in @@ -47,6 +47,7 @@ source "${ECLECTIC_CORE_PATH}/core.bash" || exit 255 source "${ECLECTIC_CORE_PATH}/output.bash" || die "Couldn't source output.bash" source "${ECLECTIC_CORE_PATH}/config.bash" || die "Couldn't source config.bash" source "${ECLECTIC_CORE_PATH}/multilib.bash" || die "Couldn't source multilib.bash" +source "${ECLECTIC_CORE_PATH}/tests.bash" || die "Couldn't source tests.bash" # Sneaky trick to make die in subshells work. If you don't get # it, don't ask... @@ -133,13 +134,29 @@ ec_do_list-modules() { # figure out what the action is. we need to know whether we're # invoked as a something-config/something-update. action="" -if [[ ${0%%-config} != ${0} ]] ; then - action=$(basename "${0}" ) - action=${action%%-config} -elif [[ ${0%%-update} != ${0} ]] ; then - action=$(basename "${0}" ) - action=${action%%-update} -elif [[ -n ${1##--} ]] ; then + +for suffix in config update tool manager ; do + if [[ ${0%%-${suffix}} != ${0} ]] ; then + action=$(basename "${0}" ) + action=${action%%-${suffix}} + break + fi +done +unset suffix + +if [[ -z ${action} ]] ; then + binname=$(basename "${0}" ) + for prefix in config update manage ; do + if [[ ${binname##${prefix}-} != ${binname} ]] ; then + action=$(basename "${0}" ) + action=${action##${prefix}-} + break + fi + done + unset binname prefix +fi + +[[ -z ${action} ]] && if [[ -n ${1##--} ]] ; then action=${1##--} shift elif [[ -n ${1} ]] ; then |