mirror of
https://git.proxmox.com/git/fwupd
synced 2025-08-14 10:22:17 +00:00
Show device description when bash completing an argument
This commit is contained in:
parent
9e965ada49
commit
c8d15f924c
@ -45,13 +45,12 @@ _show_modifiers()
|
|||||||
|
|
||||||
_show_device_ids()
|
_show_device_ids()
|
||||||
{
|
{
|
||||||
local devices
|
local description
|
||||||
devices="$(command fwupdmgr get-devices | command awk '/DeviceId/ { print $2}')"
|
OLDIFS=$IFS
|
||||||
COMPREPLY+=( $(compgen -W "${devices}" -- "$cur") )
|
IFS=$'\n'
|
||||||
#it would be nice to show device description but fwupd really doesn't like extraneous data
|
description="$(command fwupdmgr get-devices | command awk '!/DeviceId/ { line = $0 }; /DeviceId/ { print $2 " {" line "}"}')"
|
||||||
# local description
|
COMPREPLY+=( $(compgen -W "${description}" -- "$cur") )
|
||||||
# description="$(command fwupdmgr get-devices | command awk '!/DeviceId/ { line = $0 }; /DeviceId/ { print $2 " " line}')"
|
IFS=$OLDIFS
|
||||||
# COMPREPLY+=( $(compgen -W "${description}" -- "$cur") )
|
|
||||||
}
|
}
|
||||||
|
|
||||||
_show_remotes()
|
_show_remotes()
|
||||||
@ -155,4 +154,4 @@ _fwupdmgr()
|
|||||||
return 0
|
return 0
|
||||||
}
|
}
|
||||||
|
|
||||||
complete -F _fwupdmgr fwupdmgr
|
complete -F _fwupdmgr fwupdmgr
|
||||||
|
Loading…
Reference in New Issue
Block a user