# HG changeset patch # User Christophe Lincoln # Date 1335216648 -7200 # Node ID 7dd241a1171b6a8eb4756d15bf4bb172446cae21 # Parent a9f3ad0aff28c419c95fa73bf6853ca54175fa92 libtaz.sh: Store all cmdline options in a variable diff -r a9f3ad0aff28 -r 7dd241a1171b rootfs/lib/libtaz.sh --- a/rootfs/lib/libtaz.sh Tue Apr 17 01:03:14 2012 +0200 +++ b/rootfs/lib/libtaz.sh Mon Apr 23 23:30:48 2012 +0200 @@ -22,16 +22,12 @@ okcolor=32 ercolor=31 -# Parse cmdline options. +# Parse cmdline options and store values in a variable. for opt in "$@" do case "$opt" in - --raw-out) - output="raw" ;; - --gtk-out) - output="gtk" ;; - --html-out) - output="html" ;; + --*=*) export ${opt#--} ;; + --*) export ${opt#--}="yes" ;; esac done [ "$HTTP_REFERER" ] && output="html" @@ -50,9 +46,7 @@ check_root Options: - --raw-out - --gtk-out - --html-out + --output=[raw|gtk|html] EOT } diff -r a9f3ad0aff28 -r 7dd241a1171b testsuite.sh --- a/testsuite.sh Tue Apr 17 01:03:14 2012 +0200 +++ b/testsuite.sh Mon Apr 23 23:30:48 2012 +0200 @@ -21,5 +21,8 @@ output="raw" check_libtaz -echo "" +[ "$forced" ] && echo "Checking option: forced=$forced" +[ "$root" ] && echo "Checking option: root=$root" +[ ! "$1" ] && echo "Check options: $(basename $0) --forced --root=/dev/null" + exit 0