[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [Qemu-devel] [PATCH 08/16] qemu-io: Move 'help' function
From: |
Kevin Wolf |
Subject: |
Re: [Qemu-devel] [PATCH 08/16] qemu-io: Move 'help' function |
Date: |
Tue, 4 Jun 2013 12:20:06 +0200 |
User-agent: |
Mutt/1.5.21 (2010-09-15) |
Am 29.05.2013 um 23:25 hat Eric Blake geschrieben:
> On 05/28/2013 09:27 AM, Kevin Wolf wrote:
> > No reason to treat it different from other commands. Move it to
> > qemu-io-cmds.c, adapt the coding style and register it like any other
> > command.
> >
> > Signed-off-by: Kevin Wolf <address@hidden>
> > ---
> > cmd.c | 79
> > ----------------------------------------------------------
> > cmd.h | 1 -
> > qemu-io-cmds.c | 67 ++++++++++++++++++++++++++++++++++++++++++++++++-
> > 3 files changed, 66 insertions(+), 81 deletions(-)
>
> > -void
> > -help_init(void)
> > -{
> > - help_cmd.name = _("help");
> > - help_cmd.altname = _("?");
> > - help_cmd.cfunc = help_f;
> > - help_cmd.argmin = 0;
> > - help_cmd.argmax = 1;
> > - help_cmd.flags = CMD_FLAG_GLOBAL;
> > - help_cmd.args = _("[command]");
> > - help_cmd.oneline = _("help for one or all commands");
>
> The old code marked strings for translation with _(), ...
>
> > +static const cmdinfo_t help_cmd = {
> > + .name = "help",
> > + .altname = "?",
> > + .cfunc = help_f,
> > + .argmin = 0,
> > + .argmax = 1,
> > + .flags = CMD_FLAG_GLOBAL,
> > + .args = "[command]",
> > + .oneline = "help for one or all commands",
>
> ...whereas the new code uses fixed literals. Then again, po/messages.po
> doesn't contain any mention of cmd.c, so it's not like we were actually
> translating the strings, even if they were marked for translation. So
> no real change.
In fact, the real reason is that cmd.c has this line:
#define _(x) x /* not gettext support yet */
Apart from that, translating command names has never been a great idea
anyway, so at least that part wouldn't a big loss even if gettext was
actually used...
Kevin
- Re: [Qemu-devel] [PATCH 08/16] qemu-io: Move 'help' function,
Kevin Wolf <=