diff options
author | Mantas Mikulėnas <grawity@gmail.com> | 2019-05-06 12:02:10 +0300 |
---|---|---|
committer | Greg Kroah-Hartman <gregkh@linuxfoundation.org> | 2019-05-06 13:13:12 +0200 |
commit | 2dfffe8ea2173b5c79fd458d13c2fb0a70077d14 (patch) | |
tree | 55f773b788ee730cb37785fa8de4d994cb44f9c5 | |
parent | f95c78e744e68e9a0f008cd047b9fe7248b4b51e (diff) | |
download | usbutils-2dfffe8ea2173b5c79fd458d13c2fb0a70077d14.tar.gz |
lsusb.py: improve usage text
Signed-off-by: Mantas Mikulėnas <grawity@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
-rw-r--r-- | lsusb.py.in | 26 |
1 files changed, 14 insertions, 12 deletions
diff --git a/lsusb.py.in b/lsusb.py.in index 278980d..e54ee75 100644 --- a/lsusb.py.in +++ b/lsusb.py.in @@ -565,18 +565,20 @@ def fix_usbclass(): def usage(): "Displays usage information" print("Usage: lsusb.py [options]") + print() print("Options:") - print(" -h display this help") - print(" -i display interface information") - print(" -I display interface information, even for hubs") - print(" -u suppress empty hubs") - print(" -U suppress all hubs") - print(" -c use colors") - print(" -e display endpoint info") - print(" -w display warning if usb.ids is not sorted correctly") - print(" -f FILE override filename for /usr/share/usb.ids") + # "|-------|-------|-------|-------|-------" + print(" -h display this help") + print(" -i display interface information") + print(" -I display interface information, even for hubs") + print(" -u suppress empty hubs") + print(" -U suppress all hubs") + print(" -c use colors") + print(" -e display endpoint info") + print(" -w display warning if usb.ids is not sorted correctly") + print(" -f FILE override filename for /usr/share/usb.ids") + print() print("Use lsusb.py -ciu to get a nice overview of your USB devices.") - return 2 def read_usb(): "Read toplevel USB entries and print" @@ -602,7 +604,7 @@ def main(argv): (optlist, args) = getopt.gnu_getopt(argv[1:], "hiIuUwcef:", ("help",)) except getopt.GetoptError as exc: print("Error:", exc) - sys.exit(usage()) + sys.exit(2) for opt in optlist: if opt[0] == "-h" or opt[0] == "--help": usage() @@ -636,7 +638,7 @@ def main(argv): continue if len(args) > 0: print("Error: excess args %s ..." % args[0]) - sys.exit(usage()) + sys.exit(2) if usbids[0]: try: |