[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[PATCH 22/27] qemu-img: bitmap: refresh options/--help
From: |
Michael Tokarev |
Subject: |
[PATCH 22/27] qemu-img: bitmap: refresh options/--help |
Date: |
Wed, 24 Apr 2024 11:50:30 +0300 |
Add missing long options and --help output.
Signed-off-by: Michael Tokarev <mjt@tls.msk.ru>
---
qemu-img.c | 40 ++++++++++++++++++++++++++++++++--------
1 file changed, 32 insertions(+), 8 deletions(-)
diff --git a/qemu-img.c b/qemu-img.c
index fff537df26..7c20a5772d 100644
--- a/qemu-img.c
+++ b/qemu-img.c
@@ -5170,20 +5170,42 @@ static int img_bitmap(const img_cmd_t *ccmd, int argc,
char **argv)
{"source-format", required_argument, 0, 'F'},
{0, 0, 0, 0}
};
- c = getopt_long(argc, argv, ":b:f:F:g:h", long_options, NULL);
+ c = getopt_long(argc, argv, "b:f:F:g:h",
+ 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,
+"( --merge SOURCE | --add | --remove | --clear |\n"
+" --enable | --disable ).. [-f FMT | --image-opts]\n"
+" [ -b SRC_FILENAME [-F SOURCE_FMT]] [-g SIZE[KMGTPE]] [--object
OBJDEF]\n"
+" FILENAME BITMAP\n"
+,
+" -f, --format FMT\n"
+" specify FILENAME format explicitly\n"
+" --image-opts\n"
+" indicates that FILENAME is a complete image specification\n"
+" instead of a file name (incompatible with --format)\n"
+" --add\n"
+" creates BITMAP, enables to record future edits\n"
+" -g, --granularity SIZE[KMGTPE]\n"
+" sets non-default bitmap granularity for --add to this size\n"
+" --remove\n"
+" removes BITMAP\n"
+" --clear\n"
+" clears BITMAP\n"
+" --enable, --disable\n"
+" starts and stops recording future edits to BITMAP\n"
+" --merge SRC_FILENAME\n"
+" merges contents of SRC_FILENAME bitmap into BITMAP\n"
+" -b, --source-file SRC_FILENAME\n"
+" select alternative source file for --merge\n"
+" -F, --source-format SRC_FMT\n"
+" specify format for SRC_FILENAME explicitly\n"
+);
break;
case 'b':
src_filename = optarg;
@@ -5239,6 +5261,8 @@ static int img_bitmap(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 09/27] qemu-img: commit: refresh options/--help, (continued)
- [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
- [PATCH 18/27] qemu-img: resize: do not always eat last argument, Michael Tokarev, 2024/04/24
- [PATCH 20/27] qemu-img: amend: refresh options/--help, Michael Tokarev, 2024/04/24
- [PATCH 19/27] qemu-img: resize: refresh options/--help, Michael Tokarev, 2024/04/24
- [PATCH 22/27] qemu-img: bitmap: refresh options/--help,
Michael Tokarev <=
- [PATCH 21/27] qemu-img: bench: refresh options/--help, Michael Tokarev, 2024/04/24
- [PATCH 23/27] qemu-img: dd: refresh options/--help, Michael Tokarev, 2024/04/24
- [PATCH 24/27] qemu-img: measure: refresh options/--help, Michael Tokarev, 2024/04/24
- [PATCH 25/27] qemu-img: implement short --help, remove global help() function, Michael Tokarev, 2024/04/24
- [PATCH 27/27] qemu-img: extend cvtnum() and use it in more places, Michael Tokarev, 2024/04/24
- [PATCH 26/27] qemu-img: inline list of supported commands, remove qemu-img-cmds.h include, Michael Tokarev, 2024/04/24