aboutsummaryrefslogtreecommitdiff
path: root/doc/cli.sh
diff options
context:
space:
mode:
Diffstat (limited to 'doc/cli.sh')
-rwxr-xr-xdoc/cli.sh57
1 files changed, 57 insertions, 0 deletions
diff --git a/doc/cli.sh b/doc/cli.sh
new file mode 100755
index 0000000..11aa660
--- /dev/null
+++ b/doc/cli.sh
@@ -0,0 +1,57 @@
+#! /usr/bin/env bash
+
+version="0.2.0"
+date="January 2016"
+
+trap 'exit 1' ERR
+set -o errtrace # Trap in functions.
+
+function info () { echo "$*" 1>&2; }
+function error () { info "$*"; exit 1; }
+
+while [ $# -gt 0 ]; do
+ case $1 in
+ --clean)
+ rm -f brep*.xhtml brep*.1
+ exit 0
+ ;;
+ *)
+ error "unexpected $1"
+ ;;
+ esac
+done
+
+function compile ()
+{
+ local n=$1; shift
+
+ # Use a bash array to handle empty arguments.
+ #
+ local o=()
+ while [ $# -gt 0 ]; do
+ o=("${o[@]}" "$1")
+ shift
+ done
+
+ cli -I .. -v project="brep" -v version="$version" -v date="$date" \
+--include-base-last "${o[@]}" --generate-html --html-prologue-file \
+man-prologue.xhtml --html-epilogue-file man-epilogue.xhtml --html-suffix \
+.xhtml ../$n.cli
+
+ cli -I .. -v project="brep" -v version="$version" -v date="$date" \
+--include-base-last "${o[@]}" --generate-man --man-prologue-file \
+man-prologue.1 --man-epilogue-file man-epilogue.1 --man-suffix .1 \
+../$n.cli
+}
+
+o="--output-prefix brep-"
+
+# A few special cases.
+#
+#compile "brep" $o --output-prefix ""
+
+pages="load/load migrate/migrate"
+
+for p in $pages; do
+ compile $p $o
+done