aboutsummaryrefslogtreecommitdiff
path: root/doc/cli.sh
diff options
context:
space:
mode:
authorKaren Arutyunov <karen@codesynthesis.com>2020-02-07 20:29:50 +0300
committerKaren Arutyunov <karen@codesynthesis.com>2020-02-07 22:05:51 +0300
commit10e1c8cf8d98bdc0cca03d2facee38245a4a11a4 (patch)
treea5f3586800edba97bd715fb3e077c173342e0037 /doc/cli.sh
parentf2f07d8bd21029e2d2c424f293903ea99d042d6f (diff)
Add copyright variable substitution to doc/cli.sh
Diffstat (limited to 'doc/cli.sh')
-rwxr-xr-xdoc/cli.sh5
1 files changed, 4 insertions, 1 deletions
diff --git a/doc/cli.sh b/doc/cli.sh
index b449ddc..b1a2c84 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)
@@ -41,6 +43,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 \