Skip to content

Commit

Permalink
Add If Statement For Converting to Hexadecimal (#10)
Browse files Browse the repository at this point in the history
* Add If Statement For Converting to Hexadecimal

* Restyle Add If Statement For Converting to Hexadecimal (#11)

* Restyled by shellharden

* Restyled by shfmt

---------

Co-authored-by: Restyled.io <[email protected]>

* Revert "Restyle Add If Statement For Converting to Hexadecimal (#11)" (#12)

This reverts commit 24718ed.

---------

Co-authored-by: restyled-io[bot] <32688539+restyled-io[bot]@users.noreply.github.com>
Co-authored-by: Restyled.io <[email protected]>
  • Loading branch information
3 people authored Oct 20, 2023
1 parent a9b00ff commit 5afa3c8
Showing 1 changed file with 7 additions and 4 deletions.
11 changes: 7 additions & 4 deletions lsusb
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
#!/usr/bin/env bash
# shellcheck disable=SC2066
# lsusb (list USB devices) utility for macOS
# Author: JLH, Sep 2013
# Author: LanikSJ, Oct 2023
Expand All @@ -14,7 +13,7 @@ verbose() {
}

version() {
echo "lsusb for macOS 1.1"
echo "lsusb for macOS 1.1.1"
}

help() {
Expand Down Expand Up @@ -121,8 +120,12 @@ parse() {
esac
fi

# Convert bus number from hexadecimal to decimal.
bus_num=$(printf "%03d" "0x0$bus_num")
if [ ${#bus_num} -ne 0 ]; then
# Convert bus number from hexadecimal to decimal.
bus_num=$(printf "%03d" "0x0$bus_num")
else
bus_num='---'
fi

# Strip the parentheses from manufacturer name unless so specified.
if [ -z "$parens" ]; then
Expand Down

0 comments on commit 5afa3c8

Please sign in to comment.