Make update_readme.sh and genmanpage.sh use local build

It's easier to use these to keep the documentation updated, if
one doesn't have to make install before running them.
This commit is contained in:
Ari Koivula 2016-03-01 15:20:11 +02:00
parent 626b53ce85
commit b268381a48
2 changed files with 13 additions and 11 deletions

View file

@ -17,7 +17,7 @@ kvazaar \- open source HEVC encoder
.SH DESCRIPTION
EOF
kvazaar --help 2>&1 | tail -n+5 | head -n-4 | \
../src/kvazaar --help 2>&1 | tail -n+5 | head -n-4 | \
sed 's| : |\n|g;
s| :$||g;
s|^ --|.TP\n\\fB--|g;

View file

@ -1,5 +1,4 @@
#!/bin/bash
#!/bin/sh
# This file is part of Kvazaar HEVC encoder.
#
# Copyright (C) 2013-2016 Tampere University of Technology and others (see
@ -17,19 +16,22 @@
# You should have received a copy of the GNU General Public License
# along with Kvazaar. If not, see <http://www.gnu.org/licenses/>.
if [[ $# != 1 ]]; then
printf "Usage: $0 README.md\n"
exit 1
fi
# This script updates parameter documentation in ../README.md file.
LANG=C
set -e
cd "$(dirname "$0")"
tmpfile="$(mktemp)"
readme_file="../README.md"
{
sed '/BEGIN KVAZAAR HELP MESSAGE/q' -- "$1";
sed '/BEGIN KVAZAAR HELP MESSAGE/q' -- "$readme_file";
printf '```\n';
kvazaar --help;
../src/kvazaar --help;
printf '```\n';
sed -n '/END KVAZAAR HELP MESSAGE/{:a;p;n;ba}' -- "$1";
sed -n '/END KVAZAAR HELP MESSAGE/{:a;p;n;ba}' -- "$readme_file";
} >> "$tmpfile"
mv -- "$tmpfile" "$1"
mv -- "$tmpfile" "../README.md"