silence
[m6w6/btr] / lib / btr / btr.sh
index 75bb7cde9f73c5c9437bdb2a9519e098c0428483..96376efcfeba08ac79bf41d50d4a6ef8f925727a 100755 (executable)
@@ -5,22 +5,24 @@ function help {
        echo
        echo "Usage: $(basename $0) [-hv] [<options>] <repository>"
        echo
-       echo "  -h, --help        Display this help"
-       echo "  -v, --verbose   Be more verbose"
+       echo "    -h, --help      Display this help"
+       echo "    -v, --verbose   Be more verbose"
        echo
        echo "  Options:"
-       echo "  -s, --source=<rules>              Use the specified source ruleset"
-       echo "  -b, --build=<rules>                Use the specified build ruleset"
-       echo "  -r, --report=<rules>              Use the specifued report ruleset"
-       echo "  -B, --branch=<branch>            Checkout this branch"
-       echo "  -D, --directory=<directory>   Use this directory as work root"
-       echo "  -S, --suffix=<suffix>            Append suffix to the build name"
-       echo "  -C, --configure=<options>        Define \$CONFIGURE options"
+       echo "    -s, --source=<rules>          Use the specified source ruleset"
+       echo "    -b, --build=<rules>           Use the specified build ruleset"
+       echo "    -r, --report=<rules>          Use the specifued report ruleset"
+       echo "    -B, --branch=<branch>         Checkout this branch"
+       echo "    -D, --directory=<directory>   Use this directory as work root"
+       echo "    -S, --suffix=<suffix>         Append suffix to the build name"
+       echo "    -C, --configure=<options>     Define \$CONFIGURE options"
        echo
        echo "  Rulesets:"
-       echo "  source: git, svn"
-       echo "  build:  php, pecl"
-       echo "  report: mail"
+       for ruleset in source build report
+       do
+               printf "    %10s: %s\n" $ruleset \
+                       "$(find "$LIBDIR/$ruleset" -name '*.mk' -exec basename {} .mk \; | sort | xargs)"
+       done
        echo
        exit
 }
@@ -82,7 +84,7 @@ function parseopts {
                                ;;
                        -b|--build)
                                case "$2" in
-                                       php|pecl)
+                                       *)
                                                BUILD_RULES="$2"
                                                ;;
                                esac
@@ -90,7 +92,7 @@ function parseopts {
                                ;;
                        -r|--report)
                                case "$2" in
-                                       mail)
+                                       *)
                                                REPORT_RULES="$2"
                                                ;;
                                esac
@@ -142,7 +144,7 @@ function setup {
        export CONFIG_REPORT="btr+config-$BUILD-$DATE"
        export BUILD_REPORT="btr+build-$BUILD-$DATE"
        export TEST_REPORT="btr+tests-$BUILD-$DATE"
-       export LAST_REPORT=$(basename $(ls -t "$BTRDIR/btr+tests-$BUILD"* | tail -n1))
+       export LAST_REPORT=$(basename $(ls -t "$BTRDIR/btr+tests-$BUILD"* 2>/dev/null | tail -n1) 2>/dev/null)
        export REPORT=""
 }
 
@@ -181,4 +183,4 @@ function confirm {
        esac
 }
 
-# vim: set noet
+# vim: noet