From: Leandro Dorileo <l@dorileo.org>
To: Peter Maydell <peter.maydell@linaro.org>
Cc: Kevin Wolf <kwolf@redhat.com>, Fam Zheng <famz@redhat.com>,
Stefan Weil <sw@weilnetz.de>, Michael Tokarev <mjt@tls.msk.ru>,
QEMU Developers <qemu-devel@nongnu.org>,
Stefan Hajnoczi <stefanha@redhat.com>,
Paolo Bonzini <pbonzini@redhat.com>,
Laszlo Ersek <lersek@redhat.com>, Peter Lieven <pl@kamp.de>
Subject: Re: [Qemu-devel] [PATCH RFC 0/2] qemu-arg: general purpose argument parser
Date: Sat, 8 Mar 2014 20:28:36 +0000 [thread overview]
Message-ID: <20140308202836.GA2415@dorilex> (raw)
In-Reply-To: <CAFEAcA-taACSr2UP4AFDgvysx8SrKcH7thj45y4hXyyPhVQwBA@mail.gmail.com>
Hi Peter,
On Sat, Mar 08, 2014 at 06:55:50PM +0000, Peter Maydell wrote:
> On 8 March 2014 18:47, Leandro Dorileo <l@dorileo.org> wrote:
> > The following patchset introduces a general purpose argument parser and migrates
> > qemu-img to make use of it. qemu-img is just the first user of it, if we see a
> > good feedback here I move forward and migrate all the other possible users.
>
> Can you describe what the QEMU-specific features are that
> mean we must roll our own argument-parsing infrastructure
> rather than using (say) the glib option parsing routines?
I don't think GOption will do the output I want and think to be the ideal for
qemu or specially to qemu-img.
GOption knows nothing about command, since qemu-img was my first target I
wanted something to handle its command schema. GOption will not show the users
the list of available commands neither show commands specific options, I wanted
the user to run qemu-img create -h and show the create command arguments (similar
to git output). GOption will not do that by default, of course we can wrap that
and have something similar.
GOption will not be able to list commands and their arguments so we can generate
the .hx file (see patch 02 in my series) or maybe the texi output and keep the
sync between the implemented commands, arguments and the textinfo stuffs.
GOption also doesn't know about the "cumulative" stuff - well I agree this last
one is not somethig to justify qemu-arg per se.
The command callbacks flow is also something GOption will not give us for free,
we would still need to know ourself about the available commands and their
callees.
As I said, my first target was qemu-img, but I ended up writing something more
generic to be used elsewhere.
Of course I could wrap GOption or getopt and handle all the corner cases but
parsing the arguments myself gave me more flexibility.
Regards...
--
Leandro Dorileo
next prev parent reply other threads:[~2014-03-08 20:29 UTC|newest]
Thread overview: 15+ messages / expand[flat|nested] mbox.gz Atom feed top
2014-03-08 18:47 [Qemu-devel] [PATCH RFC 0/2] qemu-arg: general purpose argument parser Leandro Dorileo
2014-03-08 18:47 ` [Qemu-devel] [PATCH RFC 1/2] qemu-arg: introduce a " Leandro Dorileo
2014-03-08 18:47 ` [Qemu-devel] [PATCH RFC 2/2] qemu-img: migrate to use qemu-arg Leandro Dorileo
2014-03-09 7:30 ` Paolo Bonzini
2014-03-09 12:37 ` Leandro Dorileo
2014-03-09 13:03 ` Peter Maydell
2014-03-09 13:35 ` Leandro Dorileo
2014-03-08 18:55 ` [Qemu-devel] [PATCH RFC 0/2] qemu-arg: general purpose argument parser Peter Maydell
2014-03-08 20:28 ` Leandro Dorileo [this message]
2014-03-09 16:32 ` Andreas Färber
2014-03-09 21:47 ` Leandro Dorileo
2014-03-11 11:06 ` Kevin Wolf
2014-03-11 14:09 ` Leandro Dorileo
2014-03-11 15:22 ` Eric Blake
2014-03-16 21:23 ` Leandro Dorileo
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=20140308202836.GA2415@dorilex \
--to=l@dorileo.org \
--cc=famz@redhat.com \
--cc=kwolf@redhat.com \
--cc=lersek@redhat.com \
--cc=mjt@tls.msk.ru \
--cc=pbonzini@redhat.com \
--cc=peter.maydell@linaro.org \
--cc=pl@kamp.de \
--cc=qemu-devel@nongnu.org \
--cc=stefanha@redhat.com \
--cc=sw@weilnetz.de \
/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;
as well as URLs for NNTP newsgroup(s).