archboot/usr/share/bash-completion/completions/restore-usbstick.sh

12 lines
398 B
Bash
Raw Normal View History

2024-08-13 22:57:11 +02:00
# SPDX-License-Identifier: GPL-3.0-or-later
# created by Tobias Powalowski <tpowa@archlinux.org>
_restore_usbstick()
{
COMPREPLY=()
cur="${COMP_WORDS[COMP_CWORD]}"
compopt -o bashdefault -o default
2024-08-14 10:03:19 +02:00
COMPREPLY=( $(compgen -W "$(lsblk -pnro NAME,TRAN,TYPE | rg '(.*) disk$' -r '$1' | rg '(.*) usb$' -r '$1')" -- $cur) )
2024-08-13 22:57:11 +02:00
return 0
}
complete -F _restore_usbstick restore-usbstick.sh