Skip to content

Commit

Permalink
version: display configured tcti
Browse files Browse the repository at this point in the history
Having only the manpage contain the mapping of configured tctis can be quite
challenging, if one is trying to figure out how this software is confogured
in an environment where manpages are not available. Add, to the version
a list of configured tctis, so a simple -v provides supported, configure
information.

This information will help bug reports, as a version of the software with
different configurations may have different bugs.

Signed-off-by: William Roberts <william.c.roberts@intel.com>
  • Loading branch information
William Roberts committed Aug 29, 2017
1 parent 0f22b29 commit 7e8b7b9
Showing 1 changed file with 27 additions and 3 deletions.
30 changes: 27 additions & 3 deletions lib/options.h
Expand Up @@ -130,10 +130,34 @@ showArgMismatch (const char *name)
printf("Please type \"%s -h\" get the usage!\n", name);
}

#ifndef VERSION
#warning "VERSION Not known at compile time, not embedding..."
#define VERSION "UNKNOWN"
#endif

static inline void
showVersion (const char *name)
{
printf("%s, version %s\n", name, VERSION);
showVersion (const char *name) {
#ifdef HAVE_TCTI_TABRMD
#define TCTI_TABRMD_CONF "tabrmd,"
#else
#define TCTI_TABRMD_CONF ""
#endif

#ifdef HAVE_TCTI_SOCK
#define TCTI_SOCK_CONF "socket,"
#else
#define TCTI_SOCK_CONF ""
#endif

#ifdef HAVE_TCTI_DEV
#define TCTI_DEV_CONF "device,"
#else
#define TCTI_DEV_CONF ""
#endif

static const char *tcti_conf = TCTI_TABRMD_CONF TCTI_SOCK_CONF TCTI_DEV_CONF;
printf("tool=\"%s\" version=\"%s\" tctis=\"%s\"\n", name, VERSION,
tcti_conf);
}

#endif /* OPTIONS_H */

0 comments on commit 7e8b7b9

Please sign in to comment.