uvg266/tools/genmanpage.sh

36 lines
904 B
Bash
Raw Normal View History

2016-02-04 05:41:18 +00:00
#!/bin/sh
LANG=C
set -e
cd "$(dirname "$0")"
date="$(date +"%B %Y")"
version="$(awk '/#define KVZ_VERSION/ { print $3 }' ../src/global.h)"
2016-03-01 13:30:24 +00:00
manpage_file=../doc/kvazaar.1
2016-02-04 05:41:18 +00:00
2016-03-01 13:30:24 +00:00
cat <<EOF> $manpage_file
2016-02-04 05:41:18 +00:00
.TH KVAZAAR "1" "$date" "kvazaar v$version" "User Commands"
.SH NAME
kvazaar \- open source HEVC encoder
.SH SYNOPSIS
\fBkvazaar \fR\-i <input> \-\-input\-res <width>x<height> \-o <output>
.SH DESCRIPTION
EOF
../src/kvazaar --help 2>&1 | tail -n+5 | head -n-4 | \
sed 's| : |\n|g;
s| :$||g;
2016-02-04 05:41:18 +00:00
s|^ --|.TP\n\\fB--|g;
s|^ --|.TP\n\\fB--|g;
s|^ -|.TP\n\\fB-|g;
s|^ ||g;
s|^ ||g;
s|-|\\-|g;
s|, \\-\\-|\\fR, \\fB\\-\\-|g;' \
2016-03-01 13:30:24 +00:00
>> $manpage_file
2016-02-04 05:41:18 +00:00
for s in Slices Wpp Tiles "Parallel processing" "Video Usability Information"; do
2016-03-01 13:30:24 +00:00
sed -i "s|^ ${s}:|.SS \"${s}:\"|g" $manpage_file
2016-02-04 05:41:18 +00:00
done