All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH lttng-tools] Add version info to lttng-relayd help
@ 2016-10-20  5:58 Anders Wallin
  0 siblings, 0 replies; 5+ messages in thread
From: Anders Wallin @ 2016-10-20  5:58 UTC (permalink / raw)
  To: lttng-dev

lttng-relayd man pages states that the option
-V --version is available, but it it's missing in the code

Signed-off-by: Anders Wallin <wallinux@gmail.com>
---
 src/bin/lttng-relayd/main.c | 6 +++++-
 1 file changed, 5 insertions(+), 1 deletion(-)

diff --git a/src/bin/lttng-relayd/main.c b/src/bin/lttng-relayd/main.c
index ea46ec7..9c0e2b1 100644
--- a/src/bin/lttng-relayd/main.c
+++ b/src/bin/lttng-relayd/main.c
@@ -161,10 +161,11 @@ static struct option long_options[] = {
 	{ "output", 1, 0, 'o', },
 	{ "verbose", 0, 0, 'v', },
 	{ "config", 1, 0, 'f' },
+	{ "version", 0, 0, 'V' },
 	{ NULL, 0, 0, 0, },
 };
 
-static const char *config_ignore_options[] = { "help", "config" };
+static const char *config_ignore_options[] = { "help", "config", "version" };
 
 /*
  * Take an option from the getopt output and set it in the right variable to be
@@ -255,6 +256,9 @@ static int set_option(int opt, const char *arg, const char *optname)
 			perror("exec");
 		}
 		exit(EXIT_FAILURE);
+	case 'V':
+		fprintf(stdout, "%s\n", VERSION);
+		exit(EXIT_SUCCESS);
 	case 'o':
 		if (lttng_is_setuid_setgid()) {
 			WARN("Getting '%s' argument from setuid/setgid binary refused for security reasons.",
-- 
2.10.0

_______________________________________________
lttng-dev mailing list
lttng-dev@lists.lttng.org
https://lists.lttng.org/cgi-bin/mailman/listinfo/lttng-dev

^ permalink raw reply related	[flat|nested] 5+ messages in thread

* Re: [PATCH lttng-tools] Add version info to lttng-relayd help
       [not found] <20161020055855.28518-1-wallinux@gmail.com>
@ 2016-11-08 17:02 ` Jérémie Galarneau
  0 siblings, 0 replies; 5+ messages in thread
From: Jérémie Galarneau @ 2016-11-08 17:02 UTC (permalink / raw)
  To: Anders Wallin; +Cc: lttng-dev

Merged in master, stable-2.9, stable-2.8 and stable-2.7.

Thanks!
Jérémie

On 20 October 2016 at 01:58, Anders Wallin <wallinux@gmail.com> wrote:
> lttng-relayd man pages states that the option
> -V --version is available, but it it's missing in the code
>
> Signed-off-by: Anders Wallin <wallinux@gmail.com>
> ---
>  src/bin/lttng-relayd/main.c | 6 +++++-
>  1 file changed, 5 insertions(+), 1 deletion(-)
>
> diff --git a/src/bin/lttng-relayd/main.c b/src/bin/lttng-relayd/main.c
> index ea46ec7..9c0e2b1 100644
> --- a/src/bin/lttng-relayd/main.c
> +++ b/src/bin/lttng-relayd/main.c
> @@ -161,10 +161,11 @@ static struct option long_options[] = {
>         { "output", 1, 0, 'o', },
>         { "verbose", 0, 0, 'v', },
>         { "config", 1, 0, 'f' },
> +       { "version", 0, 0, 'V' },
>         { NULL, 0, 0, 0, },
>  };
>
> -static const char *config_ignore_options[] = { "help", "config" };
> +static const char *config_ignore_options[] = { "help", "config", "version" };
>
>  /*
>   * Take an option from the getopt output and set it in the right variable to be
> @@ -255,6 +256,9 @@ static int set_option(int opt, const char *arg, const char *optname)
>                         perror("exec");
>                 }
>                 exit(EXIT_FAILURE);
> +       case 'V':
> +               fprintf(stdout, "%s\n", VERSION);
> +               exit(EXIT_SUCCESS);
>         case 'o':
>                 if (lttng_is_setuid_setgid()) {
>                         WARN("Getting '%s' argument from setuid/setgid binary refused for security reasons.",
> --
> 2.10.0
>
> _______________________________________________
> lttng-dev mailing list
> lttng-dev@lists.lttng.org
> https://lists.lttng.org/cgi-bin/mailman/listinfo/lttng-dev



-- 
Jérémie Galarneau
EfficiOS Inc.
http://www.efficios.com
_______________________________________________
lttng-dev mailing list
lttng-dev@lists.lttng.org
https://lists.lttng.org/cgi-bin/mailman/listinfo/lttng-dev

^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: [PATCH lttng-tools] Add version info to lttng-relayd help
       [not found] ` <CA+jJMxtJf-_C-mT2=PLypZTPzxNem41h5yVHXKnS_h5-aEu3ww@mail.gmail.com>
@ 2016-10-20  5:58   ` Anders Wallin
  0 siblings, 0 replies; 5+ messages in thread
From: Anders Wallin @ 2016-10-20  5:58 UTC (permalink / raw)
  To: Jérémie Galarneau; +Cc: lttng-dev

Ok, new patch on it's way

/Anders
Anders Wallin


On Wed, Oct 19, 2016 at 10:57 PM, Jérémie Galarneau
<jeremie.galarneau@efficios.com> wrote:
> On 15 October 2016 at 02:38, Anders Wallin <wallinux@gmail.com> wrote:
>> lttng-relayd man pages states that the option
>> -V --version is available, but it it's missing in the code
>>
>> Signed-off-by: Anders Wallin <wallinux@gmail.com>
>> ---
>>  src/bin/lttng-relayd/main.c | 15 ++++++++++++++-
>>  1 file changed, 14 insertions(+), 1 deletion(-)
>>
>> diff --git a/src/bin/lttng-relayd/main.c b/src/bin/lttng-relayd/main.c
>> index ea46ec7..34a9ba1 100644
>> --- a/src/bin/lttng-relayd/main.c
>> +++ b/src/bin/lttng-relayd/main.c
>> @@ -161,10 +161,20 @@ static struct option long_options[] = {
>>         { "output", 1, 0, 'o', },
>>         { "verbose", 0, 0, 'v', },
>>         { "config", 1, 0, 'f' },
>> +       { "version", 0, 0, 'V' },
>>         { NULL, 0, 0, 0, },
>>  };
>>
>> -static const char *config_ignore_options[] = { "help", "config" };
>> +static const char *config_ignore_options[] = { "help", "config", "version" };
>> +
>> +/*
>> + * Version info on stderr
>> + */
>> +static void version(void)
>> +{
>> +       fprintf(stderr, "%s (LTTng Trace Control) " VERSION" - " VERSION_NAME "\n",
>> +               progname);
>
> Please use the short version printout, as done in the session daemon.
> Also, please output to stdout.
>
> See:
> https://github.com/lttng/lttng-tools/blob/master/src/bin/lttng-sessiond/main.c#L4686
>
>> +}
>>
>>  /*
>>   * Take an option from the getopt output and set it in the right variable to be
>> @@ -255,6 +265,9 @@ static int set_option(int opt, const char *arg, const char *optname)
>>                         perror("exec");
>>                 }
>>                 exit(EXIT_FAILURE);
>> +       case 'V':
>> +               version();
>> +               exit(EXIT_FAILURE);
>
> EXIT_FAILURE -> EXIT_SUCCESS
>
> Thanks,
> Jérémie
>
>>         case 'o':
>>                 if (lttng_is_setuid_setgid()) {
>>                         WARN("Getting '%s' argument from setuid/setgid binary refused for security reasons.",
>> --
>> 2.10.0
>>
>> _______________________________________________
>> lttng-dev mailing list
>> lttng-dev@lists.lttng.org
>> https://lists.lttng.org/cgi-bin/mailman/listinfo/lttng-dev
>
>
>
> --
> Jérémie Galarneau
> EfficiOS Inc.
> http://www.efficios.com
_______________________________________________
lttng-dev mailing list
lttng-dev@lists.lttng.org
https://lists.lttng.org/cgi-bin/mailman/listinfo/lttng-dev

^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: [PATCH lttng-tools] Add version info to lttng-relayd help
       [not found] <20161015063823.16638-1-wallinux@gmail.com>
@ 2016-10-19 20:57 ` Jérémie Galarneau
       [not found] ` <CA+jJMxtJf-_C-mT2=PLypZTPzxNem41h5yVHXKnS_h5-aEu3ww@mail.gmail.com>
  1 sibling, 0 replies; 5+ messages in thread
From: Jérémie Galarneau @ 2016-10-19 20:57 UTC (permalink / raw)
  To: Anders Wallin; +Cc: lttng-dev

On 15 October 2016 at 02:38, Anders Wallin <wallinux@gmail.com> wrote:
> lttng-relayd man pages states that the option
> -V --version is available, but it it's missing in the code
>
> Signed-off-by: Anders Wallin <wallinux@gmail.com>
> ---
>  src/bin/lttng-relayd/main.c | 15 ++++++++++++++-
>  1 file changed, 14 insertions(+), 1 deletion(-)
>
> diff --git a/src/bin/lttng-relayd/main.c b/src/bin/lttng-relayd/main.c
> index ea46ec7..34a9ba1 100644
> --- a/src/bin/lttng-relayd/main.c
> +++ b/src/bin/lttng-relayd/main.c
> @@ -161,10 +161,20 @@ static struct option long_options[] = {
>         { "output", 1, 0, 'o', },
>         { "verbose", 0, 0, 'v', },
>         { "config", 1, 0, 'f' },
> +       { "version", 0, 0, 'V' },
>         { NULL, 0, 0, 0, },
>  };
>
> -static const char *config_ignore_options[] = { "help", "config" };
> +static const char *config_ignore_options[] = { "help", "config", "version" };
> +
> +/*
> + * Version info on stderr
> + */
> +static void version(void)
> +{
> +       fprintf(stderr, "%s (LTTng Trace Control) " VERSION" - " VERSION_NAME "\n",
> +               progname);

Please use the short version printout, as done in the session daemon.
Also, please output to stdout.

See:
https://github.com/lttng/lttng-tools/blob/master/src/bin/lttng-sessiond/main.c#L4686

> +}
>
>  /*
>   * Take an option from the getopt output and set it in the right variable to be
> @@ -255,6 +265,9 @@ static int set_option(int opt, const char *arg, const char *optname)
>                         perror("exec");
>                 }
>                 exit(EXIT_FAILURE);
> +       case 'V':
> +               version();
> +               exit(EXIT_FAILURE);

EXIT_FAILURE -> EXIT_SUCCESS

Thanks,
Jérémie

>         case 'o':
>                 if (lttng_is_setuid_setgid()) {
>                         WARN("Getting '%s' argument from setuid/setgid binary refused for security reasons.",
> --
> 2.10.0
>
> _______________________________________________
> lttng-dev mailing list
> lttng-dev@lists.lttng.org
> https://lists.lttng.org/cgi-bin/mailman/listinfo/lttng-dev



-- 
Jérémie Galarneau
EfficiOS Inc.
http://www.efficios.com
_______________________________________________
lttng-dev mailing list
lttng-dev@lists.lttng.org
https://lists.lttng.org/cgi-bin/mailman/listinfo/lttng-dev

^ permalink raw reply	[flat|nested] 5+ messages in thread

* [PATCH lttng-tools] Add version info to lttng-relayd help
@ 2016-10-15  6:38 Anders Wallin
  0 siblings, 0 replies; 5+ messages in thread
From: Anders Wallin @ 2016-10-15  6:38 UTC (permalink / raw)
  To: lttng-dev

lttng-relayd man pages states that the option
-V --version is available, but it it's missing in the code

Signed-off-by: Anders Wallin <wallinux@gmail.com>
---
 src/bin/lttng-relayd/main.c | 15 ++++++++++++++-
 1 file changed, 14 insertions(+), 1 deletion(-)

diff --git a/src/bin/lttng-relayd/main.c b/src/bin/lttng-relayd/main.c
index ea46ec7..34a9ba1 100644
--- a/src/bin/lttng-relayd/main.c
+++ b/src/bin/lttng-relayd/main.c
@@ -161,10 +161,20 @@ static struct option long_options[] = {
 	{ "output", 1, 0, 'o', },
 	{ "verbose", 0, 0, 'v', },
 	{ "config", 1, 0, 'f' },
+	{ "version", 0, 0, 'V' },
 	{ NULL, 0, 0, 0, },
 };
 
-static const char *config_ignore_options[] = { "help", "config" };
+static const char *config_ignore_options[] = { "help", "config", "version" };
+
+/*
+ * Version info on stderr
+ */
+static void version(void)
+{
+	fprintf(stderr, "%s (LTTng Trace Control) " VERSION" - " VERSION_NAME "\n",
+		progname);
+}
 
 /*
  * Take an option from the getopt output and set it in the right variable to be
@@ -255,6 +265,9 @@ static int set_option(int opt, const char *arg, const char *optname)
 			perror("exec");
 		}
 		exit(EXIT_FAILURE);
+	case 'V':
+		version();
+		exit(EXIT_FAILURE);
 	case 'o':
 		if (lttng_is_setuid_setgid()) {
 			WARN("Getting '%s' argument from setuid/setgid binary refused for security reasons.",
-- 
2.10.0

_______________________________________________
lttng-dev mailing list
lttng-dev@lists.lttng.org
https://lists.lttng.org/cgi-bin/mailman/listinfo/lttng-dev

^ permalink raw reply related	[flat|nested] 5+ messages in thread

end of thread, other threads:[~2016-11-08 17:03 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2016-10-20  5:58 [PATCH lttng-tools] Add version info to lttng-relayd help Anders Wallin
     [not found] <20161020055855.28518-1-wallinux@gmail.com>
2016-11-08 17:02 ` Jérémie Galarneau
     [not found] <20161015063823.16638-1-wallinux@gmail.com>
2016-10-19 20:57 ` Jérémie Galarneau
     [not found] ` <CA+jJMxtJf-_C-mT2=PLypZTPzxNem41h5yVHXKnS_h5-aEu3ww@mail.gmail.com>
2016-10-20  5:58   ` Anders Wallin
  -- strict thread matches above, loose matches on Subject: below --
2016-10-15  6:38 Anders Wallin

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.