commit: d4fe480eed309b82de1a2370ac85ae1d2367f17d Author: Michael Orlitzky <mjo <AT> gentoo <DOT> org> AuthorDate: Sat Jan 9 02:13:41 2016 +0000 Commit: Michael Orlitzky <mjo <AT> gentoo <DOT> org> CommitDate: Sat Jan 9 02:13:41 2016 +0000 URL: https://gitweb.gentoo.org/proj/eselect-php.git/commit/?id=d4fe480e
Clean up check_module() a bit and give it some documentation. src/php.eselect.in | 16 +++++++++++++++- 1 file changed, 15 insertions(+), 1 deletion(-) 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}" }