[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[PATCH 10/27] qemu-img: compare: refresh options/--help
From: |
Michael Tokarev |
Subject: |
[PATCH 10/27] qemu-img: compare: refresh options/--help |
Date: |
Wed, 24 Apr 2024 11:50:18 +0300 |
Signed-off-by: Michael Tokarev <mjt@tls.msk.ru>
---
qemu-img.c | 45 +++++++++++++++++++++++++++++++++++++--------
1 file changed, 37 insertions(+), 8 deletions(-)
diff --git a/qemu-img.c b/qemu-img.c
index 7a111bce72..ea66bfa195 100644
--- a/qemu-img.c
+++ b/qemu-img.c
@@ -1488,25 +1488,52 @@ static int img_compare(const img_cmd_t *ccmd, int argc,
char **argv)
for (;;) {
static const struct option long_options[] = {
{"help", no_argument, 0, 'h'},
+ {"quiet", no_argument, 0, 'q'},
{"object", required_argument, 0, OPTION_OBJECT},
+ {"cache", required_argument, 0, 'T'},
{"image-opts", no_argument, 0, OPTION_IMAGE_OPTS},
+ {"a-format", required_argument, 0, 'f'},
+ {"left-format", required_argument, 0, 'f'},
+ {"b-format", required_argument, 0, 'F'},
+ {"right-format", required_argument, 0, 'F'},
{"force-share", no_argument, 0, 'U'},
+ {"strict", no_argument, 0, 's'},
+ {"progress", no_argument, 0, 'p'},
{0, 0, 0, 0}
};
- c = getopt_long(argc, argv, ":hf:F:T:pqsU",
+ c = getopt_long(argc, argv, "hf:F:T:pqsU",
long_options, NULL);
if (c == -1) {
break;
}
switch (c) {
- case ':':
- missing_argument(argv[optind - 1]);
- break;
- case '?':
- unrecognized_option(argv[optind - 1]);
- break;
case 'h':
- help();
+ cmd_help(ccmd,
+"[--image-opts | [-f FMT] [-F FMT]] [-s]\n"
+" [-T CACHE] [-U] [--object OBJDEF] FILENAME1 FILENAME2\n"
+,
+" -q, --quiet\n"
+" quiet operation\n"
+" -p, --progress\n"
+" show operation progress\n"
+" -f, --a-format FMT\n"
+" specify FILENAME1 image format explicitly\n"
+" -F, --b-format FMT\n"
+" specify FILENAME2 image format explicitly\n"
+" --image-opts\n"
+" indicates that FILENAMEs are complete image specifications\n"
+" instead of file names (incompatible with --a-format and --b-format)\n"
+" -s, --strict\n"
+" strict mode, also check if sizes are equal\n"
+" -T, --cache CACHE_MODE\n"
+" images caching mode (" BDRV_DEFAULT_CACHE ")\n"
+" -U, --force-share\n"
+" open images in shared mode for concurrent access\n"
+" --object OBJDEF\n"
+" QEMU user-creatable object (eg encryption key)\n"
+" FILENAME1, FILENAME2\n"
+" image files (or specifications) to compare\n"
+);
break;
case 'f':
fmt1 = optarg;
@@ -1547,6 +1574,8 @@ static int img_compare(const img_cmd_t *ccmd, int argc,
char **argv)
case OPTION_IMAGE_OPTS:
image_opts = true;
break;
+ default:
+ tryhelp(argv[0]);
}
}
--
2.39.2
- [PATCH v3 00/27] qemu-img: refersh options and --help handling, cleanups, Michael Tokarev, 2024/04/24
- [PATCH 01/27] qemu-img: measure: convert img_size to signed, simplify handling, Michael Tokarev, 2024/04/24
- [PATCH 02/27] qemu-img: create: convert img_size to signed, simplify handling, Michael Tokarev, 2024/04/24
- [PATCH 03/27] qemu-img: global option processing and error printing, Michael Tokarev, 2024/04/24
- [PATCH 04/27] qemu-img: pass current cmd info into command handlers, Michael Tokarev, 2024/04/24
- [PATCH 05/27] qemu-img: create: refresh options/--help, Michael Tokarev, 2024/04/24
- [PATCH 06/27] qemu-img: factor out parse_output_format() and use it in the code, Michael Tokarev, 2024/04/24
- [PATCH 10/27] qemu-img: compare: refresh options/--help,
Michael Tokarev <=
- [PATCH 11/27] qemu-img: convert: refresh options/--help, Michael Tokarev, 2024/04/24
- [PATCH 07/27] qemu-img: check: refresh options/--help, Michael Tokarev, 2024/04/24
- [PATCH 08/27] qemu-img: simplify --repair error message, Michael Tokarev, 2024/04/24
- [PATCH 09/27] qemu-img: commit: refresh options/--help, Michael Tokarev, 2024/04/24
- [PATCH 13/27] qemu-img: map: refresh options/--help, Michael Tokarev, 2024/04/24
- [PATCH 14/27] qemu-img: snapshot: allow specifying -f fmt, Michael Tokarev, 2024/04/24
- [PATCH 12/27] qemu-img: info: refresh options/--help, Michael Tokarev, 2024/04/24
- [PATCH 15/27] qemu-img: snapshot: make -l (list) the default, simplify option handling, Michael Tokarev, 2024/04/24
- [PATCH 16/27] qemu-img: snapshot: refresh options/--help, Michael Tokarev, 2024/04/24
- [PATCH 17/27] qemu-img: rebase: refresh options/--help, Michael Tokarev, 2024/04/24