Date: Fri, 4 Jun 2021 22:47:48 GMT From: Warner Losh <imp@FreeBSD.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org Subject: git: 1b5bc3a54b60 - main - usbdump: style: Sort case statements alphabetically Message-ID: <202106042247.154MlmIA092769@gitrepo.freebsd.org>
next in thread | raw e-mail | index | archive | help
The branch main has been updated by imp: URL: https://cgit.FreeBSD.org/src/commit/?id=1b5bc3a54b60f6476cce7191a7618a9d52b95d7f commit 1b5bc3a54b60f6476cce7191a7618a9d52b95d7f Author: Warner Losh <imp@FreeBSD.org> AuthorDate: 2021-06-04 22:42:18 +0000 Commit: Warner Losh <imp@FreeBSD.org> 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 */
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?202106042247.154MlmIA092769>