X-Git-Url: http://git.efficios.com/?p=lttng-tools.git;a=blobdiff_plain;f=src%2Fbin%2Flttng%2Fcommands%2Fversion.c;h=6459e7b9f09abfe5bd25427eed783b8dad860a7f;hp=a2409c304e06304dc181361275241c2d162cbdf6;hb=a3bc3918a3e9f219cc54adcc41dd6b37381b30ff;hpb=6c1c0768320135c6936c371b09731851b508c023 diff --git a/src/bin/lttng/commands/version.c b/src/bin/lttng/commands/version.c index a2409c304..6459e7b9f 100644 --- a/src/bin/lttng/commands/version.c +++ b/src/bin/lttng/commands/version.c @@ -15,7 +15,6 @@ * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. */ -#define _GNU_SOURCE #define _LGPL_SOURCE #include #include @@ -24,11 +23,17 @@ #include #include #include -#include #include #include "../command.h" +#include "version.h" + +#ifdef LTTNG_EMBED_HELP +static const char help_msg[] = +#include +; +#endif enum { OPT_HELP = 1, @@ -44,19 +49,6 @@ static struct poptOption long_options[] = { {0, 0, 0, 0, 0, 0, 0} }; -/* - * usage - */ -static void usage(FILE *ofp) -{ - fprintf(ofp, "usage: lttng version [OPTIONS]\n"); - fprintf(ofp, "\n"); - fprintf(ofp, "Options:\n"); - fprintf(ofp, " -h, --help Show this help\n"); - fprintf(ofp, " --list-options Simple listing of options\n"); - fprintf(ofp, "\n"); -} - /* * create_version */ @@ -150,13 +142,12 @@ int cmd_version(int argc, const char **argv) while ((opt = poptGetNextOpt(pc)) != -1) { switch (opt) { case OPT_HELP: - usage(stdout); + SHOW_HELP(); goto end; case OPT_LIST_OPTIONS: list_cmd_options(stdout, long_options); goto end; default: - usage(stderr); ret = CMD_UNDEFINED; goto end; } @@ -168,8 +159,14 @@ int cmd_version(int argc, const char **argv) MSG("lttng version " VERSION " - " VERSION_NAME "%s", GIT_VERSION[0] == '\0' ? "" : " - " GIT_VERSION); MSG("\n" VERSION_DESCRIPTION "\n"); - MSG("Web site: http://lttng.org"); + MSG("Web site: https://lttng.org"); MSG("\n%s", lttng_license); + if (EXTRA_VERSION_NAME[0] != '\0') { + MSG("\nExtra version name: " EXTRA_VERSION_NAME); + } + if (EXTRA_VERSION_DESCRIPTION[0] != '\0') { + MSG("\nExtra version description:\n\t" EXTRA_VERSION_DESCRIPTION); + } } end: