Mirror of the lttng-dev mailing list
 help / color / mirror / Atom feed
From: dgoulet@efficios.com (David Goulet)
Subject: [lttng-dev] [MI-prototype] MI: mi-lttng into libcommon, global option lttng_mi_opt , command version
Date: Wed, 26 Mar 2014 09:56:39 -0400	[thread overview]
Message-ID: <20140326135639.GA8104@thessa> (raw)
In-Reply-To: <20140325184906.GA1538@gmail.com>

> > > +/*
> > >   *  cmd_version
> > >   */
> > >  int cmd_version(int argc, const char **argv)
> > >  {
> > >  	int opt, ret = CMD_SUCCESS;
> > >  	static poptContext pc;
> > > +	struct mi_writer *writer = NULL;
> > > +	struct lttng_version version;
> > >  
> > >  	pc = poptGetContext(NULL, argc, argv, long_options, 0);
> > >  	poptReadDefaultConfig(pc, 0);
> > > @@ -78,12 +97,58 @@ int cmd_version(int argc, const char **argv)
> > >  		}
> > >  	}
> > >  
> > > -	MSG("lttng version " VERSION " - " VERSION_NAME);
> > > -	MSG("\n" VERSION_DESCRIPTION "\n");
> > > -	MSG("Web site: http://lttng.org");
> > > -	MSG("\nlttng is free software and under the GPL license and part LGPL");
> > > +	if (lttng_opt_mi) {
> > 
> > I would go for a function to print the mi like maybe "print_mi()" since
> > this *may* change depending on what output type we use. For now, only
> > one but let's think ahead :) and this allow to handle the mi writer
> > destruction in one specific call also, cleaner in the long run I think.
> Okai, we got a patch comming for list ( need some cleanup, internal
> code review and 2 features) but you might want to check the way we
> incorporate the mi into the command and tell us what you think. Cause
> with your comment I think we are heading the wrong way.
> https://github.com/PSRCode/lttng-tools-dev/commit/23b3a771083dc9abbf80aa9a46087b0ea9fd5959

What I meant here is to simply have a static function in the same file
that do this job below. This is just easier in terms of code separation
in the long run so keep everything but move it to a function that
handles "mi printouts".

Cheers!
David
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 603 bytes
Desc: Digital signature
URL: <http://lists.lttng.org/pipermail/lttng-dev/attachments/20140326/1ce70599/attachment.pgp>


  reply	other threads:[~2014-03-26 13:56 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
     [not found] <20140321172505.GA9511@gmail.com>
     [not found] ` <20140325144745.GB7702@thessa>
2014-03-25 18:49   ` Jonathan Rajotte
2014-03-26 13:56     ` David Goulet [this message]
2014-03-28  6:15   ` Jonathan R.Julien

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20140326135639.GA8104@thessa \
    --to=dgoulet@efficios.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox