diff options
author | Karen Arutyunov <karen@codesynthesis.com> | 2020-02-07 20:37:33 +0300 |
---|---|---|
committer | Karen Arutyunov <karen@codesynthesis.com> | 2020-02-07 21:33:03 +0300 |
commit | 3e5686780ba41ffe035e24c57c81f58fb0107715 (patch) | |
tree | fe68c06af42421fbf676f83b6c48d88097b3250a /doc | |
parent | c7b2fe50d6cda696c33bb1db45b500aed86e6c16 (diff) |
Add copyright variable substitution to doc/cli.sh
Diffstat (limited to 'doc')
-rwxr-xr-x | doc/cli.sh | 32 |
1 files changed, 24 insertions, 8 deletions
@@ -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' ../COPYRIGHT)" + while [ $# -gt 0 ]; do case $1 in --clean) @@ -36,9 +38,15 @@ function compile () shift done - cli -I .. -v project="bdep" -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 \ + cli -I .. \ +-v project="bdep" \ +-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 \ --link-regex '%b([-.].+)%../../build2/doc/b$1%' \ --link-regex '%testscript(#.+)?%../../build2/doc/build2-testscript-manual.xhtml$1%' \ --link-regex '%bpkg([-.].+)%../../bpkg/doc/bpkg$1%' \ @@ -47,9 +55,15 @@ man-prologue.xhtml --html-epilogue-file man-epilogue.xhtml --html-suffix .xhtml --link-regex '%bdep(#.+)?%build2-project-manager-manual.xhtml$1%' \ ../bdep/$n.cli - cli -I .. -v project="bdep" -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="bdep" \ +-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 \ --link-regex '%bpkg(#.+)?%$1%' \ --link-regex '%brep(#.+)?%$1%' \ --link-regex '%bdep(#.+)?%$1%' \ @@ -91,12 +105,14 @@ function xhtml_to_ps () # <from> <to> [<html2ps-options>] 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 \ --link-regex '%b([-.].+)%../../build2/doc/b$1%' \ --link-regex '%build2(#.+)?%../../build2/doc/build2-build-system-manual.xhtml$1%' \ ---output-prefix build2-project-manager- manual.cli +--output-prefix build2-project-manager- \ +manual.cli xhtml_to_ps build2-project-manager-manual.xhtml build2-project-manager-manual-a4.ps -f doc.html2ps:a4.html2ps ps2pdf14 -sPAPERSIZE=a4 -dOptimize=true -dEmbedAllFonts=true build2-project-manager-manual-a4.ps build2-project-manager-manual-a4.pdf |