diff mbox series

[05/23] qemu-img: simplify --repair error message

Message ID 33b6a64202469681f7b27892f2c1c5fe4884a60e.1707513011.git.mjt@tls.msk.ru
State New
Headers show
Series qemu-img: refersh options and --help handling | expand

Commit Message

Michael Tokarev Feb. 9, 2024, 9:22 p.m. UTC
Signed-off-by: Michael Tokarev <mjt@tls.msk.ru>
---
 qemu-img.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

Comments

Daniel P. Berrangé Feb. 20, 2024, 5:40 p.m. UTC | #1
On Sat, Feb 10, 2024 at 12:22:26AM +0300, Michael Tokarev wrote:
> Signed-off-by: Michael Tokarev <mjt@tls.msk.ru>
> ---
>  qemu-img.c | 4 ++--
>  1 file changed, 2 insertions(+), 2 deletions(-)
> 
> diff --git a/qemu-img.c b/qemu-img.c
> index 3ae07bfae0..ad7fa033b1 100644
> --- a/qemu-img.c
> +++ b/qemu-img.c
> @@ -843,8 +843,8 @@ static int img_check(const img_cmd_t *ccmd, int argc, char **argv)
>              } else if (!strcmp(optarg, "all")) {
>                  fix = BDRV_FIX_LEAKS | BDRV_FIX_ERRORS;
>              } else {
> -                error_exit(ccmd, "Unknown option value for -r "
> -                           "(expecting 'leaks' or 'all'): %s", optarg);
> +                error_exit(ccmd,
> +                           "--repair expects 'leaks' or 'all' not '%s'", optarg);
>              }

Should we say  '--repair/-r expects...' since we don't know which the
user passed

Either way

  Reviewed-by: Daniel P. Berrangé <berrange@redhat.com>

With regards,
Daniel
diff mbox series

Patch

diff --git a/qemu-img.c b/qemu-img.c
index 3ae07bfae0..ad7fa033b1 100644
--- a/qemu-img.c
+++ b/qemu-img.c
@@ -843,8 +843,8 @@  static int img_check(const img_cmd_t *ccmd, int argc, char **argv)
             } else if (!strcmp(optarg, "all")) {
                 fix = BDRV_FIX_LEAKS | BDRV_FIX_ERRORS;
             } else {
-                error_exit(ccmd, "Unknown option value for -r "
-                           "(expecting 'leaks' or 'all'): %s", optarg);
+                error_exit(ccmd,
+                           "--repair expects 'leaks' or 'all' not '%s'", optarg);
             }
             break;
         case OPTION_OUTPUT: