# HG changeset patch # User Matti Hamalainen # Date 1569257231 -10800 # Node ID 41c1d786ff0826a2001925c325531f8c3bad597a # Parent 8917c39ef6c5037b98bf403f3fc17c4fb30ce4da Add th_print_version(). diff -r 8917c39ef6c5 -r 41c1d786ff08 th_util.c --- a/th_util.c Thu Sep 19 06:20:17 2019 +0300 +++ b/th_util.c Mon Sep 23 19:47:11 2019 +0300 @@ -65,6 +65,15 @@ } +void th_print_version(FILE *outFile) +{ + fprintf(outFile, "%s", th_prog_name); + if (th_prog_version != NULL) + fprintf(outFile, " v%s", th_prog_version); + fprintf(outFile, "\n"); +} + + int th_term_width() { char *var = getenv("COLUMNS"); diff -r 8917c39ef6c5 -r 41c1d786ff08 th_util.h --- a/th_util.h Thu Sep 19 06:20:17 2019 +0300 +++ b/th_util.h Mon Sep 23 19:47:11 2019 +0300 @@ -124,6 +124,7 @@ void th_init(char *name, char *desc, char *version, char *author, char *license); void th_print_banner(FILE *outFile, const char *binName, const char *usage); +void th_print_version(FILE *outFile); int th_term_width(); int th_term_height();