aboutsummaryrefslogtreecommitdiff
path: root/bin
diff options
context:
space:
mode:
authorCiaran McCreesh <ciaranm@gentoo.org>2005-05-09 00:02:32 +0000
committerCiaran McCreesh <ciaranm@gentoo.org>2005-05-09 00:02:32 +0000
commit92a5315914bb6e022b4110fa495c7820bb8410f4 (patch)
tree0bb724488ace4342ea1bd8ecdb1df8057a274f10 /bin
parentno foreign. (diff)
parentupdated config module (diff)
downloadeselect-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-xbin/eclectic.in31
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