[Koha-patches] [PATCH] [ENH] Add --disabled to koha-list command
Judit
judit at calyx.net.au
Mon Dec 19 12:16:50 CET 2011
Add --disabled to koha-list command
---
debian/scripts/koha-list | 8 ++++++--
1 files changed, 6 insertions(+), 2 deletions(-)
diff --git a/debian/scripts/koha-list b/debian/scripts/koha-list
index 1e19f1a..459e5ca 100755
--- a/debian/scripts/koha-list
+++ b/debian/scripts/koha-list
@@ -34,9 +34,10 @@ help() {
Lists Koha instances, optionally only those that are enabled or have
email turned on.
-Usage: $0 [--enabled] [--email] [-h]
+Usage: $0 [--enabled|--disabled] [--email|--noemail] [-h]
Options:
--enabled only show instances that are enabled
+ --disabled only show instances that are disabled
--email only show instances that have email enabled
--noemail only show instances that do not have email enabled
-h this help
@@ -47,9 +48,10 @@ eoh
}
enabled=no
+disabled=no
email=no
noemail=no
-args=$(getopt -l enabled,email,noemail -o h -n $0 -- "$@")
+args=$(getopt -l enabled,disabled,email,noemail -o h -n $0 -- "$@")
set -- $args
while [ ! -z "$1" ]
do
@@ -57,6 +59,7 @@ do
-h) help; exit;;
--email) email=yes;;
--enabled) enabled=yes;;
+ --disabled) disabled=yes;;
--noemail) noemail=yes;;
*) break;;
esac
@@ -68,6 +71,7 @@ sort |
while read name
do
[ "$enabled" = yes ] && ! is_enabled "$name" && continue
+ [ "$disabled" = yes ] && is_enabled "$name" && continue
[ "$email" = yes ] && [ ! -e /var/lib/koha/$name/email.enabled ] && continue
[ "$noemail" = yes ] && [ -e /var/lib/koha/$name/email.enabled ] && continue
echo "$name"
--
1.7.4.1
More information about the Koha-patches
mailing list