From nobody Thu Nov 13 06:06:18 2025 Delivered-To: importer@patchew.org Received-SPF: pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.17; envelope-from=qemu-devel-bounces+importer=patchew.org@nongnu.org; helo=lists.gnu.org; Authentication-Results: mx.zohomail.com; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=fail(p=none dis=none) header.from=virtuozzo.com ARC-Seal: i=1; a=rsa-sha256; t=1578990242; cv=none; d=zohomail.com; s=zohoarc; b=QmR1W8iCb4YB78/Fyc9v8WnIrQElUdJN+OFqsDPkfzlRRhSt/Ld//YltCp6c9GWdLaFXcmIz//ISU2j3tFZbyoJQ/KmJ7Fhxdg59QpUCFuR8UViye/XVU9FC6A0t4F1D7e6J0AKUIDtEqvNFTmeoeNTytFX96sklJi1S8xNTmd8= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1578990242; h=Cc:Date:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Archive:List-Help:List-Unsubscribe:Message-ID:References:Sender:Subject:To; bh=HfynBENOhJfY8HyAP18NVp3y69FMVBaN0vwsiAoZx9I=; b=ZYq3oxyBY7qyEGOYNP+wRRAY4IfoVm18hwaSPl80n2cR/K8TN2tA4CUlynRQZwCr/Ka9CGHMPufpdcKcrC3EUvTDH+IsGACtCHTet9D3oB0hMsCITx8KUkUNVH6L1H8vMi8rfpEnF8l9qHY7pIIdkOqVfwNTmWkYmLPoUyxLzo0= ARC-Authentication-Results: i=1; mx.zohomail.com; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=fail header.from= (p=none dis=none) header.from= Return-Path: Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 1578990242375839.1670389675108; Tue, 14 Jan 2020 00:24:02 -0800 (PST) Received: from localhost ([::1]:34398 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1irHUX-0003rg-3n for importer@patchew.org; Tue, 14 Jan 2020 03:24:01 -0500 Received: from eggs.gnu.org ([2001:470:142:3::10]:48263) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1irHT2-00021x-8X for qemu-devel@nongnu.org; Tue, 14 Jan 2020 03:22:29 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1irHT1-0006lL-6K for qemu-devel@nongnu.org; Tue, 14 Jan 2020 03:22:28 -0500 Received: from relay.sw.ru ([185.231.240.75]:36834) by eggs.gnu.org with esmtps (TLS1.0:DHE_RSA_AES_256_CBC_SHA1:32) (Exim 4.71) (envelope-from ) id 1irHSy-0006jl-Ij; Tue, 14 Jan 2020 03:22:24 -0500 Received: from dhcp-172-16-25-136.sw.ru ([172.16.25.136] helo=localhost.sw.ru) by relay.sw.ru with esmtp (Exim 4.92.3) (envelope-from ) id 1irHSs-0005Ix-1G; Tue, 14 Jan 2020 11:22:18 +0300 From: Andrey Shinkevich To: qemu-block@nongnu.org Subject: [PATCH v3 2/3] qemu-img: sort key options alphabetically Date: Tue, 14 Jan 2020 11:22:16 +0300 Message-Id: <1578990137-308222-3-git-send-email-andrey.shinkevich@virtuozzo.com> X-Mailer: git-send-email 1.8.3.1 In-Reply-To: <1578990137-308222-1-git-send-email-andrey.shinkevich@virtuozzo.com> References: <1578990137-308222-1-git-send-email-andrey.shinkevich@virtuozzo.com> X-detected-operating-system: by eggs.gnu.org: GNU/Linux 3.x [fuzzy] X-Received-From: 185.231.240.75 X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: kwolf@redhat.com, vsementsov@virtuozzo.com, armbru@redhat.com, qemu-devel@nongnu.org, andrey.shinkevich@virtuozzo.com, den@openvz.org, mreitz@redhat.com Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: "Qemu-devel" Content-Transfer-Encoding: quoted-printable MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Put qemu-img key options in the alphabetical order in the code for a faster finding. Suggested-by: Eric Blake Signed-off-by: Andrey Shinkevich --- qemu-img.c | 22 +++++++++++----------- 1 file changed, 11 insertions(+), 11 deletions(-) diff --git a/qemu-img.c b/qemu-img.c index 6233b8c..c86f760 100644 --- a/qemu-img.c +++ b/qemu-img.c @@ -703,7 +703,7 @@ static int img_check(int argc, char **argv) {"force-share", no_argument, 0, 'U'}, {0, 0, 0, 0} }; - c =3D getopt_long(argc, argv, ":hf:r:T:qU", + c =3D getopt_long(argc, argv, ":f:hqr:T:U", long_options, &option_index); if (c =3D=3D -1) { break; @@ -715,11 +715,14 @@ static int img_check(int argc, char **argv) case '?': unrecognized_option(argv[optind - 1]); break; + case 'f': + fmt =3D optarg; + break; case 'h': help(); break; - case 'f': - fmt =3D optarg; + case 'q': + quiet =3D true; break; case 'r': flags |=3D BDRV_O_RDWR; @@ -733,18 +736,15 @@ static int img_check(int argc, char **argv) "(expecting 'leaks' or 'all'): %s", optarg); } break; - case OPTION_OUTPUT: - output =3D optarg; - break; case 'T': cache =3D optarg; break; - case 'q': - quiet =3D true; - break; case 'U': force_share =3D true; break; + case OPTION_IMAGE_OPTS: + image_opts =3D true; + break; case OPTION_OBJECT: { QemuOpts *opts; opts =3D qemu_opts_parse_noisily(&qemu_object_opts, @@ -753,8 +753,8 @@ static int img_check(int argc, char **argv) return 1; } } break; - case OPTION_IMAGE_OPTS: - image_opts =3D true; + case OPTION_OUTPUT: + output =3D optarg; break; } } --=20 1.8.3.1