zsh-workers
 help / color / mirror / code / Atom feed
864137933a97d85bf0fa3420822f858a9b6eddd7 blob 865 bytes (raw)

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
 
#compdef lsusb

local context state line usbidsline vendorid pair
typeset -A opt_args

_arguments \
  '(-v --verbose)'{-v,--verbose}'[be verbose]' \
  '-s:bus and/or devnum to show:' \
  '-d:vendor and product to show:->vendorproduct' \
  '-D:device to show:_files' \
  '-t[dump the physical USB device hierarchy as a tree]' \
  '(-V --version)'{-V,--version}'[print version info and exit]' && return 0

  if [[ ${+_lsusb_vendors} -eq 0 ]]; then
    typeset -A _lsusb_vendors _lsusb_devices
  while IFS="" read usbidsline
  do
    case "$usbidsline" in
      ((#b)([0-9a-f]##)\ ##(*))
        vendorid="$match[1]"
        _lsusb_vendors[$vendorid]="$match[2]"
      ;;
      ((\	(#b)([0-9a-f]##)\ ##(*)))
        pair="$vendorid:$match[1]"
        _lsusb_devices[${pair}]="$match[2]"
      ;;
    esac
  done < /usr/share/misc/usb.ids
fi

compadd -k _lsusb_devices
debug log:

solving 8641379 ...
found 8641379 in https://inbox.vuxu.org/zsh-workers/1432017889-21585-1-git-send-email-mikachu@gmail.com/
found 17240e0 in https://git.vuxu.org/mirror/zsh/
preparing index
index prepared:
100644 17240e03d2374b0f189859c7608529166ce59364	Completion/Linux/Command/_lsusb

applying [1/1] https://inbox.vuxu.org/zsh-workers/1432017889-21585-1-git-send-email-mikachu@gmail.com/
diff --git a/Completion/Linux/Command/_lsusb b/Completion/Linux/Command/_lsusb
index 17240e0..8641379 100644

Checking patch Completion/Linux/Command/_lsusb...
Applied patch Completion/Linux/Command/_lsusb cleanly.

index at:
100644 864137933a97d85bf0fa3420822f858a9b6eddd7	Completion/Linux/Command/_lsusb

Code repositories for project(s) associated with this public inbox

	https://git.vuxu.org/mirror/zsh/

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).