aboutsummaryrefslogtreecommitdiff
path: root/doc/cli.sh
diff options
context:
space:
mode:
authorKaren Arutyunov <karen@codesynthesis.com>2020-02-07 21:12:53 +0300
committerKaren Arutyunov <karen@codesynthesis.com>2020-02-07 21:12:53 +0300
commit22467c0f8a537482b7bab08ee044d5d24345b8e9 (patch)
tree6e8c9cc2d7eaec1420f06028c0bf1fbb364c58e1 /doc/cli.sh
parentcc05a9d50197abaaacdf7680e9e7f27b96cb39c2 (diff)
Add copyright variable substitution to doc/cli.sh
Diffstat (limited to 'doc/cli.sh')
-rwxr-xr-xdoc/cli.sh31
1 files changed, 23 insertions, 8 deletions
diff --git a/doc/cli.sh b/doc/cli.sh
index 2e1acc3..928c31a 100755
--- a/doc/cli.sh
+++ b/doc/cli.sh
@@ -1,7 +1,6 @@
#! /usr/bin/env bash
version=0.13.0-a.0.z
-date="$(date +"%B %Y")"
trap 'exit 1' ERR
set -o errtrace # Trap in functions.
@@ -9,6 +8,9 @@ set -o errtrace # Trap in functions.
function info () { echo "$*" 1>&2; }
function error () { info "$*"; exit 1; }
+date="$(date +"%B %Y")"
+copyright="$(sed -n -re 's%^Copyright \(c\) (.+)$%\1%p' ../LICENSE | head -n 1)"
+
while [ $# -gt 0 ]; do
case $1 in
--clean)
@@ -34,14 +36,26 @@ function compile ()
shift
done
- cli -I .. -v project="bbot" -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="bbot" \
+-v version="$version" \
+-v date="$date" \
+-v copyright="$copyright" \
+--include-base-last "${o[@]}" \
+--generate-html --html-suffix .xhtml \
+--html-prologue-file man-prologue.xhtml \
+--html-epilogue-file man-epilogue.xhtml \
+../$n.cli
- cli -I .. -v project="bbot" -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 \
+ cli -I .. \
+-v project="bbot" \
+-v version="$version" \
+-v date="$date" \
+-v copyright="$copyright" \
+--include-base-last "${o[@]}" \
+--generate-man --man-suffix .1 \
+--man-prologue-file man-prologue.1 \
+--man-epilogue-file man-epilogue.1 \
../$n.cli
}
@@ -76,6 +90,7 @@ function compile_doc () # <file> <prefix> <suffix>
cli -I .. \
-v version="$(echo "$version" | sed -e 's/^\([^.]*\.[^.]*\).*/\1/')" \
-v date="$date" \
+-v copyright="$copyright" \
--generate-html --html-suffix .xhtml \
--html-prologue-file doc-prologue.xhtml \
--html-epilogue-file doc-epilogue.xhtml \