gregkh / usbutils

USB utilities for Linux, including lsusb
http://www.linux-usb.org
354 stars 199 forks source link

The returned value of the "lsusb -h" command is not 0. #170

Closed Zhanghongtao2417 closed 1 year ago

Zhanghongtao2417 commented 1 year ago

[root@localhost ~]# lsusb -h Usage: lsusb [options]... List USB devices -v, --verbose Increase verbosity (show descriptors) -s [[bus]:][devnum] Show only devices with specified device and/or bus numbers (in decimal) -d vendor:[product] Show only devices with the specified vendor and product ID numbers (in hexadecimal) -D device Selects which device lsusb will examine -t, --tree Dump the physical USB device hierarchy as a tree -V, --version Show version of program -h, --help Show usage and help [root@localhost ~]# echo $? 1 [root@localhost ~]#

gregkh commented 1 year ago

Ah, never noticed this, let me go fix it up, thanks for the report!

gregkh commented 1 year ago

Now fixed in commit 882a852d06321968a420fda46aef0c52b8220eae

Zhanghongtao2417 commented 1 year ago

Now fixed in commit 882a852 I'd suggest

return help ? 0 : EXIT_FAILURE;

gregkh commented 1 year ago

Oops, right, also we need to check err.

And doing ? : is not ever a good idea, spell out the if statement, makes it easier to maintain over time.

Now fixed in 09af21c154cf