aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMantas Mikulėnas <grawity@gmail.com>2019-05-06 12:02:25 +0300
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>2019-05-06 14:29:36 +0200
commitc374901dcb037001a4d094ca7905696b6e54017d (patch)
treed878dd98c1705f4a430390ce37f4da9eb182a4a4
parent9f4a5512cf3360f01fff8e34ba429fa73b1851eb (diff)
downloadusbutils-c374901dcb037001a4d094ca7905696b6e54017d.tar.gz
lsusb.py: use 'elif' where suitable
Signed-off-by: Mantas Mikulėnas <grawity@gmail.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
-rw-r--r--lsusb.py.in29
1 files changed, 12 insertions, 17 deletions
diff --git a/lsusb.py.in b/lsusb.py.in
index 7608956..75d23d8 100644
--- a/lsusb.py.in
+++ b/lsusb.py.in
@@ -12,7 +12,10 @@
# Py2 compat
from __future__ import print_function
-import os, sys, re, getopt
+import getopt
+import os
+import re
+import sys
# Global options
showint = False
@@ -513,32 +516,24 @@ def main(argv):
if opt[0] in {"-h", "--help"}:
usage()
sys.exit(0)
- if opt[0] in {"-i", "--interfaces"}:
+ elif opt[0] in {"-i", "--interfaces"}:
showint = True
- continue
- if opt[0] in {"-I", "--hub-interfaces"}:
+ elif opt[0] in {"-I", "--hub-interfaces"}:
showint = True
showhubint = True
- continue
- if opt[0] in {"-u", "--hide-empty-hubs"}:
+ elif opt[0] in {"-u", "--hide-empty-hubs"}:
noemptyhub = True
- continue
- if opt[0] in {"-U", "--hide-hubs"}:
+ elif opt[0] in {"-U", "--hide-hubs"}:
noemptyhub = True
nohub = True
- continue
- if opt[0] in {"-c", "--color"}:
+ elif opt[0] in {"-c", "--color"}:
cols = (norm, bold, red, green, amber, blue)
- continue
- if opt[0] == "-w":
+ elif opt[0] == "-w":
print("Warning: option -w is no longer supported", file=sys.stderr)
- continue
- if opt[0] in {"-f", "--usbids-path"}:
+ elif opt[0] in {"-f", "--usbids-path"}:
usbids = [opt[1]]
- continue
- if opt[0] in {"-e", "--endpoints"}:
+ elif opt[0] in {"-e", "--endpoints"}:
showeps = True
- continue
if len(args) > 0:
print("Error: excess args %s ..." % args[0], file=sys.stderr)
sys.exit(2)