OSDN Git Service

autoget_manpages.sh: Add option to specify thresh
authorAkihiro MOTOKI <amotoki@gmail.com>
Fri, 23 Jan 2015 13:18:35 +0000 (22:18 +0900)
committerAkihiro MOTOKI <amotoki@gmail.com>
Fri, 23 Jan 2015 13:18:35 +0000 (22:18 +0900)
tools/autogen_manpages.sh

index cb15ee0..96c7005 100755 (executable)
@@ -2,6 +2,19 @@
 
 THRESH=80
 
+usage_exit() {
+    echo "Usage: $0 [-m minimum-perc]"
+    exit 1
+}
+
+while getopts hm: OPT; do
+    case $OPT in
+        m) THRESH=$OPTARG ;;
+        #h) usage_exit ;;
+        h|\?) usage_exit ;;
+    esac
+done
+
 SCRIPT_DIR=$(cd $(dirname $0) && pwd)
 
 VENV=../$SCRIPT_DIR/../venv
@@ -25,6 +38,7 @@ fi
 make
 
 echo 'Starting watchmedo to generate draft pages automatically...'
+echo "(minimum threshold is ${THRESH}%)"
 watchmedo shell-command \
     --command "make THRESH=$THRESH; date; echo" \
     --wait --recursive \