qemu-devel.nongnu.org archive mirror
 help / color / mirror / Atom feed
From: Michael Tokarev <mjt@tls.msk.ru>
To: qemu-devel@nongnu.org, qemu-block@nongnu.org
Cc: Michael Tokarev <mjt@tls.msk.ru>
Subject: [PATCH 00/23] qemu-img: refersh options and --help handling
Date: Sat, 10 Feb 2024 00:22:21 +0300	[thread overview]
Message-ID: <cover.1707513011.git.mjt@tls.msk.ru> (raw)

Quite big patchset implementing normal, readable qemu-img --help
(and qemu-img COMMAND --help) output with readable descriptions,
and adding many long options in the process.

In the end I stopped using qemu-img-opts.hx in qemu-img.c, perhaps
this can be avoided, with only list of commands and their desrciptions
kept there, but I don't see big advantage here.  The same list should
be included in docs/tools/qemu-img.rst, - this is not done now.

Also each command syntax isn't reflected in the doc for now, because
I want to give good names for options first, - and there, we've quite
some inconsistences and questions.  For example, measure --output=OFMT
-O OFMT, - this is priceless :)  I've no idea why we have this ugly
--output=json thing, why not have --json? ;)  I gave the desired
format long name --target-format to avoid clash with --output.

For rebase, src vs tgt probably should be renamed in local variables
too, and I'm not even sure I've got the caches right. For caches,
the thing is inconsistent across commands.

For compare, I used --a-format/--b-format (for -f/-F), - this can
be made --souce-format and --target-format, to compare source (file1)
with target (file2).

For bitmap, things are scary, I'm not sure what -b SRC_FILENAME
really means, - for now I gave it --source option, but this does
not make it more clear, suggestions welcome.

There are many other inconsistencies, I can't fix them all in one
go.. :)

Michael Tokarev (23):
  qemu-img: pass current cmd info into command handlers
  qemu-img: refresh options/--help for "create" subcommand
  qemu-img: factor out parse_output_format() and use it in the code
  qemu-img: refresh options/--help for "check" command
  qemu-img: simplify --repair error message
  qemu-img: refresh options/--help for "commit" command
  qemu-img: refresh options/--help for "compare" command
  qemu-img: refresh options/--help for "convert" command
  qemu-img: refresh options/--help for "info" command
  qemu-img: refresh options/--help for "map" command
  qemu-img: allow specifying -f fmt for snapshot subcommand
  qemu-img: make -l (list) the default for "snapshot" subcommand
  qemu-img: refresh options/--help for "snapshot" command
  qemu-img: refresh options/--help for "rebase" command
  qemu-img: resize: do not always eat last argument
  qemu-img: refresh options/--help for "resize" command
  qemu-img: refresh options/--help for "amend" command
  qemu-img: refresh options/--help for "bench" command
  qemu-img: refresh options/--help for "bitmap" command
  qemu-img: refresh options/--help for "dd" command
  qemu-img: refresh options/--help for "measure" command
  qemu-img: implement short --help, remove global help() function
  qemu-img: inline list of supported commands, remove qemu-img-cmds.h
    include

 docs/tools/qemu-img.rst |   2 +-
 qemu-img-cmds.hx        |   4 +-
 qemu-img.c              | 843 ++++++++++++++++++++++++++--------------
 3 files changed, 558 insertions(+), 291 deletions(-)

-- 
2.39.2



             reply	other threads:[~2024-02-09 21:23 UTC|newest]

Thread overview: 43+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2024-02-09 21:22 Michael Tokarev [this message]
2024-02-09 21:22 ` [PATCH 01/23] qemu-img: pass current cmd info into command handlers Michael Tokarev
2024-02-20 17:29   ` Daniel P. Berrangé
2024-02-09 21:22 ` [PATCH 02/23] qemu-img: refresh options/--help for "create" subcommand Michael Tokarev
2024-02-20 18:41   ` Daniel P. Berrangé
2024-02-09 21:22 ` [PATCH 03/23] qemu-img: factor out parse_output_format() and use it in the code Michael Tokarev
2024-02-20 17:38   ` Daniel P. Berrangé
2024-02-09 21:22 ` [PATCH 04/23] qemu-img: refresh options/--help for "check" command Michael Tokarev
2024-02-09 21:22 ` [PATCH 05/23] qemu-img: simplify --repair error message Michael Tokarev
2024-02-20 17:40   ` Daniel P. Berrangé
2024-02-09 21:22 ` [PATCH 06/23] qemu-img: refresh options/--help for "commit" command Michael Tokarev
2024-02-09 21:22 ` [PATCH 07/23] qemu-img: refresh options/--help for "compare" command Michael Tokarev
2024-02-09 21:22 ` [PATCH 08/23] qemu-img: refresh options/--help for "convert" command Michael Tokarev
2024-02-09 21:22 ` [PATCH 09/23] qemu-img: refresh options/--help for "info" command Michael Tokarev
2024-02-09 21:22 ` [PATCH 10/23] qemu-img: refresh options/--help for "map" command Michael Tokarev
2024-02-09 21:22 ` [PATCH 11/23] qemu-img: allow specifying -f fmt for snapshot subcommand Michael Tokarev
2024-02-09 21:41   ` Michael Tokarev
2024-02-20 17:41   ` Daniel P. Berrangé
2024-02-09 21:22 ` [PATCH 12/23] qemu-img: make -l (list) the default for "snapshot" subcommand Michael Tokarev
2024-02-20 17:45   ` Daniel P. Berrangé
2024-02-20 18:51     ` Michael Tokarev
2024-02-21 12:12       ` Michael Tokarev
2024-02-09 21:22 ` [PATCH 13/23] qemu-img: refresh options/--help for "snapshot" command Michael Tokarev
2024-02-09 21:22 ` [PATCH 14/23] qemu-img: refresh options/--help for "rebase" command Michael Tokarev
2024-02-09 21:22 ` [PATCH 15/23] qemu-img: resize: do not always eat last argument Michael Tokarev
2024-02-20 17:57   ` Daniel P. Berrangé
2024-02-21 12:19     ` Michael Tokarev
2024-02-09 21:22 ` [PATCH 16/23] qemu-img: refresh options/--help for "resize" command Michael Tokarev
2024-02-09 21:22 ` [PATCH 17/23] qemu-img: refresh options/--help for "amend" command Michael Tokarev
2024-02-09 21:22 ` [PATCH 18/23] qemu-img: refresh options/--help for "bench" command Michael Tokarev
2024-02-09 21:22 ` [PATCH 19/23] qemu-img: refresh options/--help for "bitmap" command Michael Tokarev
2024-02-09 21:22 ` [PATCH 20/23] qemu-img: refresh options/--help for "dd" command Michael Tokarev
2024-02-09 21:22 ` [PATCH 21/23] qemu-img: refresh options/--help for "measure" command Michael Tokarev
2024-02-09 21:22 ` [PATCH 22/23] qemu-img: implement short --help, remove global help() function Michael Tokarev
2024-02-20 18:46   ` Daniel P. Berrangé
2024-02-09 21:22 ` [PATCH 23/23] qemu-img: inline list of supported commands, remove qemu-img-cmds.h include Michael Tokarev
2024-02-20 18:48   ` Daniel P. Berrangé
2024-02-20 19:02     ` Michael Tokarev
2024-02-20 19:06       ` Daniel P. Berrangé
2024-02-21 16:31     ` Michael Tokarev
2024-02-21 16:45       ` Daniel P. Berrangé
2024-02-09 22:26 ` [PATCH 00/23] qemu-img: refersh options and --help handling Michael Tokarev
2024-02-20 18:53 ` Daniel P. Berrangé

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=cover.1707513011.git.mjt@tls.msk.ru \
    --to=mjt@tls.msk.ru \
    --cc=qemu-block@nongnu.org \
    --cc=qemu-devel@nongnu.org \
    /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).