X-Git-Url: https://git.lttng.org/?p=lttng-tools.git;a=blobdiff_plain;f=src%2Fbin%2Flttng%2Fcommands%2Fversion.cpp;fp=src%2Fbin%2Flttng%2Fcommands%2Fversion.cpp;h=0e59b8dbfb8af31e7dd5677e4d796146d9ddae28;hp=e4aed95ad8ac3ad442442240098598c9e05ffe95;hb=28ab034a2c3582d07d3423d2d746731f87d3969f;hpb=52e345b9ac912d033c2a2c25a170a01cf209839d diff --git a/src/bin/lttng/commands/version.cpp b/src/bin/lttng/commands/version.cpp index e4aed95ad..0e59b8dbf 100644 --- a/src/bin/lttng/commands/version.cpp +++ b/src/bin/lttng/commands/version.cpp @@ -6,6 +6,11 @@ */ #define _LGPL_SOURCE +#include "../command.hpp" +#include "version.hpp" + +#include + #include #include #include @@ -14,15 +19,10 @@ #include #include -#include - -#include "../command.hpp" -#include "version.hpp" - #ifdef LTTNG_EMBED_HELP static const char help_msg[] = #include -; + ; #endif enum { @@ -34,9 +34,9 @@ static const char *lttng_license = "lttng is free software and under the GPL lic static struct poptOption long_options[] = { /* longName, shortName, argInfo, argPtr, value, descrip, argDesc */ - {"help", 'h', POPT_ARG_NONE, 0, OPT_HELP, 0, 0}, - {"list-options", 0, POPT_ARG_NONE, NULL, OPT_LIST_OPTIONS, NULL, NULL}, - {0, 0, 0, 0, 0, 0, 0} + { "help", 'h', POPT_ARG_NONE, 0, OPT_HELP, 0, 0 }, + { "list-options", 0, POPT_ARG_NONE, NULL, OPT_LIST_OPTIONS, NULL, NULL }, + { 0, 0, 0, 0, 0, 0, 0 } }; /* @@ -71,24 +71,21 @@ static int print_mi(void) } /* Open the command element */ - ret = mi_lttng_writer_command_open(writer, - mi_lttng_element_command_version); + ret = mi_lttng_writer_command_open(writer, mi_lttng_element_command_version); if (ret) { ret = CMD_ERROR; goto error; } /* Beginning of output */ - ret = mi_lttng_writer_open_element(writer, - mi_lttng_element_command_output); + ret = mi_lttng_writer_open_element(writer, mi_lttng_element_command_output); if (ret) { ret = CMD_ERROR; goto error; } /* Print the machine interface of version */ - ret = mi_lttng_version(writer, &version, - VERSION_DESCRIPTION, lttng_license); + ret = mi_lttng_version(writer, &version, VERSION_DESCRIPTION, lttng_license); if (ret) { ret = CMD_ERROR; goto error; @@ -147,7 +144,7 @@ int cmd_version(int argc, const char **argv) ret = print_mi(); } else { MSG("lttng version " VERSION " - " VERSION_NAME "%s", - GIT_VERSION[0] == '\0' ? "" : " - " GIT_VERSION); + GIT_VERSION[0] == '\0' ? "" : " - " GIT_VERSION); MSG("\n" VERSION_DESCRIPTION "\n"); MSG("Web site: https://lttng.org"); MSG("\n%s", lttng_license);