Compare commits

...

2 Commits

Author SHA1 Message Date
Antonio Álvarez Feijoo 206cfcbccb
Merge 9092a50dbf into f6793bbcf0 2024-11-20 18:13:45 +00:00
Antonio Alvarez Feijoo 9092a50dbf
bash-completion: add --list-devices to systemd-cryptenroll
And also use it to list suitable block devices.
2024-11-20 09:58:54 +01:00
1 changed files with 3 additions and 3 deletions

View File

@ -40,8 +40,8 @@ __get_tpm2_devices() {
__get_block_devices() {
local i
for i in /dev/*; do
[ -b "$i" ] && printf '%s\n' "$i"
for i in $(systemd-cryptenroll --list-devices); do
[ -L "$i" ] || printf '%s\n' "$i"
done
}
@ -50,7 +50,7 @@ _systemd_cryptenroll() {
local cur=${COMP_WORDS[COMP_CWORD]} prev=${COMP_WORDS[COMP_CWORD-1]} words cword
local -A OPTS=(
[STANDALONE]='-h --help --version
--password --recovery-key'
--password --recovery-key --list-devices'
[ARG]='--unlock-key-file
--unlock-fido2-device
--unlock-tpm2-device