From owner-dev-commits-src-main@freebsd.org Fri Jun 4 22:47:49 2021 Return-Path: Delivered-To: dev-commits-src-main@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 7BEF36567AB; Fri, 4 Jun 2021 22:47:49 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4FxdFd3181z3GG0; Fri, 4 Jun 2021 22:47:49 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 33B5625897; Fri, 4 Jun 2021 22:47:49 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.16.1/8.16.1) with ESMTP id 154MlmlL092770; Fri, 4 Jun 2021 22:47:48 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 154MlmIA092769; Fri, 4 Jun 2021 22:47:48 GMT (envelope-from git) Date: Fri, 4 Jun 2021 22:47:48 GMT Message-Id: <202106042247.154MlmIA092769@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Warner Losh Subject: git: 1b5bc3a54b60 - main - usbdump: style: Sort case statements alphabetically MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: imp X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: 1b5bc3a54b60f6476cce7191a7618a9d52b95d7f Auto-Submitted: auto-generated X-BeenThere: dev-commits-src-main@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: Commit messages for the main branch of the src repository List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 04 Jun 2021 22:47:49 -0000 The branch main has been updated by imp: URL: https://cgit.FreeBSD.org/src/commit/?id=1b5bc3a54b60f6476cce7191a7618a9d52b95d7f commit 1b5bc3a54b60f6476cce7191a7618a9d52b95d7f Author: Warner Losh AuthorDate: 2021-06-04 22:42:18 +0000 Commit: Warner Losh CommitDate: 2021-06-04 22:47:28 +0000 usbdump: style: Sort case statements alphabetically Switch case statement for getopt args should be sorted alphabetically. Sponsored by: Netflix --- usr.sbin/usbdump/usbdump.c | 34 +++++++++++++++++----------------- 1 file changed, 17 insertions(+), 17 deletions(-) diff --git a/usr.sbin/usbdump/usbdump.c b/usr.sbin/usbdump/usbdump.c index 00d3b8e8913b..3c4f93f80c72 100644 --- a/usr.sbin/usbdump/usbdump.c +++ b/usr.sbin/usbdump/usbdump.c @@ -834,6 +834,9 @@ main(int argc, char *argv[]) optstring = "b:d:hi:r:s:vw:f:"; while ((o = getopt(argc, argv, optstring)) != -1) { switch (o) { + case 'b': + b_arg = optarg; + break; case 'd': pp = optarg; if (pp[0] == 'u' && pp[1] == 'g' && pp[2] == 'e' && pp[3] == 'n') @@ -866,6 +869,20 @@ main(int argc, char *argv[]) } } break; + case 'f': + filt_unit = strtol(optarg, &pp, 10); + filt_ep = -1; + if (pp != NULL) { + if (*pp == '.') { + filt_ep = strtol(pp + 1, &pp, 10); + if (pp != NULL && *pp != 0) + usage(); + } else if (*pp != 0) { + usage(); + } + } + add_filter(filt_unit, filt_ep); + break; case 'i': i_arg = optarg; break; @@ -884,9 +901,6 @@ main(int argc, char *argv[]) if (snapshot == 0) snapshot = -1; break; - case 'b': - b_arg = optarg; - break; case 'v': verbose++; break; @@ -894,20 +908,6 @@ main(int argc, char *argv[]) w_arg = optarg; init_wfile(p); break; - case 'f': - filt_unit = strtol(optarg, &pp, 10); - filt_ep = -1; - if (pp != NULL) { - if (*pp == '.') { - filt_ep = strtol(pp + 1, &pp, 10); - if (pp != NULL && *pp != 0) - usage(); - } else if (*pp != 0) { - usage(); - } - } - add_filter(filt_unit, filt_ep); - break; default: usage(); /* NOTREACHED */