Mercurial > hg > th-libs
changeset 489:41c1d786ff08
Add th_print_version().
author | Matti Hamalainen <ccr@tnsp.org> |
---|---|
date | Mon, 23 Sep 2019 19:47:11 +0300 |
parents | 8917c39ef6c5 |
children | ad647427303a |
files | th_util.c th_util.h |
diffstat | 2 files changed, 10 insertions(+), 0 deletions(-) [+] |
line wrap: on
line diff
--- 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");
--- 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();