summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMichael Orlitzky <mjo@gentoo.org>2016-01-08 21:13:41 -0500
committerMichael Orlitzky <mjo@gentoo.org>2016-01-08 21:13:41 -0500
commitd4fe480eed309b82de1a2370ac85ae1d2367f17d (patch)
tree72759b022c062361abc9813b842bbe57a805215f
parentRemove superfluous list_foo() functions. (diff)
downloadeselect-php-d4fe480e.tar.gz
eselect-php-d4fe480e.tar.bz2
eselect-php-d4fe480e.zip
Clean up check_module() a bit and give it some documentation.
-rw-r--r--src/php.eselect.in16
1 files changed, 15 insertions, 1 deletions
diff --git a/src/php.eselect.in b/src/php.eselect.in
index 26c43d8..d19b93a 100644
--- a/src/php.eselect.in
+++ b/src/php.eselect.in
@@ -382,8 +382,22 @@ resolv_target() {
fi
}
+
+# Die if the given module name is not valid.
+#
+# INPUT:
+#
+# A module name.
+#
+# OUTPUT:
+#
+# None; the function will die() if the given module name is invalid
+# (that is, not one of our declared $MODULES), and do nothing
+# otherwise.
+#
check_module() {
- has $1 $(echo $MODULES) || \
+ local module="${1}"
+ has "${module}" $MODULES || \
die -q "Please choose one of the following modules: ${MODULES}"
}