From 20ecb128cd78bf2ef446ddeeded5d426cc6d1dae Mon Sep 17 00:00:00 2001 From: Marko Viitanen Date: Tue, 3 May 2022 16:35:25 +0300 Subject: [PATCH] [cleanup] Print uvg266 version every time the CLI is launched, fix manpage and README gen --- src/cli.c | 2 -- src/encmain.c | 2 ++ tools/genmanpage.sh | 2 +- tools/update_readme.sh | 2 +- 4 files changed, 4 insertions(+), 4 deletions(-) diff --git a/src/cli.c b/src/cli.c index 753d8eac..5e8d9908 100644 --- a/src/cli.c +++ b/src/cli.c @@ -385,7 +385,6 @@ void cmdline_opts_free(const uvg_api *const api, cmdline_opts_t *opts) void print_usage(void) { - print_version(); fprintf(stdout, "usage: -i and --input-res to set input, -o to set output\n" " --help for more information\n"); @@ -401,7 +400,6 @@ void print_version(void) void print_help(void) { - print_version(); fprintf(stdout, "Usage:\n" "uvg266 -i --input-res x -o \n" diff --git a/src/encmain.c b/src/encmain.c index 21aa0cce..1b19f5fb 100644 --- a/src/encmain.c +++ b/src/encmain.c @@ -479,6 +479,8 @@ int main(int argc, char *argv[]) const uvg_api * const api = uvg_api_get(8); + print_version(); + opts = cmdline_opts_parse(api, argc, argv); // If problem with command line options, print banner and shutdown. if (!opts) { diff --git a/tools/genmanpage.sh b/tools/genmanpage.sh index 3bfd2352..7db037c0 100755 --- a/tools/genmanpage.sh +++ b/tools/genmanpage.sh @@ -18,7 +18,7 @@ uvg266 \- open source VVC encoder .SH DESCRIPTION EOF -../bin/uvg266 --help 2>&1 | tail -n+5 | head -n-4 | \ +../bin/uvg266 --help 2>&1 | tail -n+5 | \ sed 's| : |\n|g; s| :$||g; s|^ --|.TP\n\\fB--|g; diff --git a/tools/update_readme.sh b/tools/update_readme.sh index 519c5b78..78669dbe 100755 --- a/tools/update_readme.sh +++ b/tools/update_readme.sh @@ -42,7 +42,7 @@ readme_file="../README.md" { sed '/BEGIN UVG266 HELP MESSAGE/q' -- "$readme_file"; printf '```\n'; - ../bin/uvg266 --help; + ../bin/uvg266 --help 2>&1 | tail -n+2; printf '```\n'; sed -n '/END UVG266 HELP MESSAGE/{:a;p;n;ba}' -- "$readme_file"; } >> "$tmpfile"