mirror of
https://github.com/ultravideo/uvg266.git
synced 2024-11-23 18:14:06 +00:00
[cli] To print version info to stdout when everything is ok.
This commit is contained in:
parent
c8539a3701
commit
feb8a4d2e3
|
@ -391,9 +391,9 @@ void print_usage(void)
|
|||
}
|
||||
|
||||
|
||||
void print_version(void)
|
||||
void print_version(bool to_stderr)
|
||||
{
|
||||
fprintf(stdout,
|
||||
fprintf(to_stderr ? stderr : stdout,
|
||||
"uvg266 " VERSION_STRING " [" UVG_COMPILER_STRING "] " UVG_COMPILE_DATE "\n");
|
||||
}
|
||||
|
||||
|
|
|
@ -65,7 +65,7 @@ cmdline_opts_t* cmdline_opts_parse(const uvg_api *api, int argc, char *argv[]);
|
|||
void cmdline_opts_free(const uvg_api *api, cmdline_opts_t *opts);
|
||||
|
||||
void print_usage(void);
|
||||
void print_version(void);
|
||||
void print_version(bool);
|
||||
void print_help(void);
|
||||
void print_frame_info(const uvg_frame_info *const info,
|
||||
const double frame_psnr[3],
|
||||
|
|
|
@ -479,23 +479,24 @@ 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) {
|
||||
print_version(false);
|
||||
print_usage();
|
||||
|
||||
goto exit_failure;
|
||||
}
|
||||
if (opts->version) {
|
||||
print_version();
|
||||
print_version(false);
|
||||
goto done;
|
||||
}
|
||||
if (opts->help) {
|
||||
print_help();
|
||||
goto done;
|
||||
}
|
||||
print_version(true);
|
||||
|
||||
input = open_input_file(opts->input);
|
||||
if (input == NULL) {
|
||||
|
|
Loading…
Reference in a new issue