1
0
Fork 0
mirror of git://git.code.sf.net/p/zsh/code synced 2025-10-08 09:41:14 +02:00

41726: add + and = to option specs taking arguments and update options to 1.7.5

This commit is contained in:
Oliver Kiddle 2017-09-18 17:21:16 +02:00
parent da085b7a20
commit c2a189b336
2 changed files with 56 additions and 31 deletions

View file

@ -1,5 +1,8 @@
2017-09-18 Oliver Kiddle <opk@zsh.org> 2017-09-18 Oliver Kiddle <opk@zsh.org>
* 41726: Completion/Linux/Command/_cryptsetup: add + and = to
option specs taking arguments and update options to 1.7.5
* 41720: Completion/Linux/Command/_chrt, * 41720: Completion/Linux/Command/_chrt,
Completion/Linux/Command/_ionice, Completion/Linux/Command/_ionice,
Completion/Linux/Command/_losetup, Completion/Linux/Command/_losetup,

View file

@ -3,47 +3,63 @@
local curcontext="$curcontext" ret=1 local curcontext="$curcontext" ret=1
local -a actions state line expl local -a actions state line expl
_arguments \ _arguments -s \
'(-v --verbose)'{-v,--verbose}'[enable verbose mode]' \ '(-v --verbose)'{-v,--verbose}'[enable verbose mode]' \
'--debug[enable debug mode]' \ '--debug[enable debug mode]' \
'(-h --hash)'{-h,--hash}'[hash algorithm]:hash algorithm' \ '(-c --cipher)'{-c+,--cipher=}'[set cipher]:cipher specification' \
'(-c --cipher)'{-c,--cipher}'[set cipher]:cipher specification' \ '(-h --hash)'{-h+,--hash=}'[hash algorithm]:hash algorithm' \
'(-y --verify-passphrase)'{-y,--verify-passphrase}'[query for password twice]' \ '(-y --verify-passphrase)'{-y,--verify-passphrase}'[query for password twice]' \
'(-d --key-file)'{-d,--key-file}'[set keyfile]:key file:_files' \ '(-d --key-file)'{-d+,--key-file=}'[set keyfile]:key file:_files' \
'(-l --keyfile-size)'{-l,--keyfile-size}'[set keyfile size]:size (bytes)' \ '--master-key-file=[set master key]:key file:_files' \
'--new-keyfile-size[set new keyfile size (luksAddKey)]:size (bytes)' \
'--master-key-file[set master key]:key file:_files' \
'--dump-master-key[dump luks master key]' \ '--dump-master-key[dump luks master key]' \
'(-s --key-size)'{-s+,--key-size=}'[set key size]:size (bits)' \
'(-l --keyfile-size)'{-l+,--keyfile-size=}'[set keyfile size]:size (bytes)' \
'--keyfile-offset=[specify number of bytes to skip in keyfile]:offset (bytes)' \
'--new-keyfile-size=[set new keyfile size (luksAddKey)]:size (bytes)' \
'--new-keyfile-offset=[specify number of bytes to skip in newly added keyfile]:offset (bytes)' \
'(-S --key-slot)'{-S+,--key-slot=}'[select key slot]:key slot' \
'(-b --size)'{-b+,--size=}'[force device size]:sectors' \
'(-o --offset)'{-o+,--offset=}'[set start offset]:sectors' \
'(-p --skip)'{-p+,--skip=}'[data to skip at beginning]:sectors' \
'(-r --readonly)'{-r,--readonly}'[create a read-only mapping]' \
'(-i --iter-time)'{-i+,--iter-time=}'[set password processing duration]:duration (milliseconds)' \
'(-q --batch-mode)'{-q,--batch-mode}"[don't ask for confirmation]" \
'(-t --timeout)'{-t+,--timeout=}'[set password prompt timeout]:timeout (seconds)' \
'(-T --tries)'{-T+,--tries=}'[set maximum number of retries]:number of retries' \
'--align-payload=[set payload alignment]:sectors' \
'--header-backup-file=[specify file with LUKS header and keyslots backup]:file:_files' \
'(--use-urandom)--use-random[use /dev/random to generate volume key]' \ '(--use-urandom)--use-random[use /dev/random to generate volume key]' \
'(--use-random)--use-urandom[use /dev/urandom to generate volume key]' \ '(--use-random)--use-urandom[use /dev/urandom to generate volume key]' \
'(-S --key-slot)'{-S,--key-slot}'[select key slot]:key slot' \ '--shared[share device with another non-overlapping crypt segment]' \
'(-s --key-size)'{-s,--key-size}'[set key size]:size (bits)' \ '--uuid=[set device UUID]:uuid' \
'(-b --size)'{-b,--size}'[force device size]:sectors' \ '--allow-discards[allow discards (aka TRIM) requests for device]' \
'(-o --offset)'{-o,--offset}'[set start offset]:sectors' \ '--header=[device or file with separated LUKS header]:file:_files' \
'(-p --skip)'{-p,--skip}'[data to skip at beginning]:sectors' \ '--test-passphrase[do not activate device, just check passphrase]' \
'--readonly[set up read-only mapping]' \ '--tcrypt-hidden[use hidden header (hidden TCRYPT device)]' \
'(-i --iter-time)'{-i,--iter-time}'[set password processing duration]:duration (milliseconds)' \ '--tcrypt-system[device is system TCRYPT drive (with bootloader)]' \
'(-q --batch-mode)'{-q,--batch-mode}'[do not ask for confirmation]' \ '--tcrypt-backup[use backup (secondary) TCRYPT header]' \
'(-t --timeout)'{-t,--timeout}'[set password prompt timeout]:timeout (seconds)' \ '--veracrypt[scan also for VeraCrypt compatible device]' \
'(-T --tries)'{-T,--tries}'[set maximum number of retries]:number of retries' \ '(-M --type)'{-M+,--type=}'[specify type of device metadata]:type:(luks plain loopaes tcrypt)' \
'--align-payload[set payload alignment]:sectors' \ '--force-password[disable password quality check (if enabled)]' \
'--uuid[set device UUID]:uuid' \ '--perf-same_cpu_crypt[use dm-crypt same_cpu_crypt performance compatibility option]' \
'--perf-submit_from_crypt_cpus[use dm-crypt submit_from_crypt_cpus performance compatibility option]' \
'(- : *)--version[show version information]' \ '(- : *)--version[show version information]' \
'(- : *)'{-\?,--help}'[display help information]' \
'(- : *)--usage[display brief usage]' \
':action:->actions' \ ':action:->actions' \
'*::arguments:->action-arguments' && ret=0 '*::arguments:->action-arguments' && ret=0
case $state in case $state in
actions) actions)
actions=( actions=(
'create:create a mapping' 'open:open device with named mapping'
'remove:remove an existing mapping' 'close:close device (remove mapping)'
'status:report mapping status' 'status:report mapping status'
'resize:resize an active mapping' 'resize:resize an active mapping'
'benchmark:benchmark cipher'
'repair:try to repair on-disk metadata'
'erase:erase all keyslots'
'luksFormat:initialize a LUKS partition' 'luksFormat:initialize a LUKS partition'
'luksOpen:open LUKS partition'
'luksClose:remove an existing mapping'
'luksSuspend:suspend active device'
'luksResume:resume suspended device'
'luksAddKey:add a new key' 'luksAddKey:add a new key'
'luksRemoveKey:remove a key' 'luksRemoveKey:remove a key'
'luksChangeKey:change a key' 'luksChangeKey:change a key'
@ -51,6 +67,9 @@ case $state in
'luksUUID:print/change device UUID' 'luksUUID:print/change device UUID'
'isLuks:check if device is a LUKS partition' 'isLuks:check if device is a LUKS partition'
'luksDump:dump header information' 'luksDump:dump header information'
'tcryptDump:dump TCRYPT device information'
'luksSuspend:suspend LUKS device and wipe key'
'luksResume:resume suspended LUKS device'
'luksHeaderBackup:store binary backup of headers' 'luksHeaderBackup:store binary backup of headers'
'luksHeaderRestore:restore header backup' 'luksHeaderRestore:restore header backup'
) )
@ -61,18 +80,21 @@ case $state in
local mapping=':mapping:_path_files -W /dev/mapper' local mapping=':mapping:_path_files -W /dev/mapper'
local device=':device:_files' local device=':device:_files'
case ${words[1]} in case ${words[1]} in
create) args=( $mapping $device );; create) args=( $mapping $device '--type=:type' );;
open) args=( $device $mapping '--type=:type' );;
(plain|luks|loopaes|tcrypt)Open) args=( $device $mapping '--type=:type' );;
benchmark) args=( '--cipher=:cipher' );;
luksKillSlot) args=( $device ':key slot number' );; luksKillSlot) args=( $device ':key slot number' );;
luksOpen) args=( $device $mapping );; remove|status|resize|*lose|luksSuspend|luksResume) args=( $mapping );;
remove|status|resize|luksClose|luksSuspend|luksResume) args=( $mapping );; erase|repair|(luks(AddKey|Erase|RemoveKey|DelKey|UUID|Dump)|isLuks))
luks(AddKey|RemoveKey|DelKey|UUID|Dump)|isLuks) args=( $device );; args=( $device )
;;
luks(Format|AddKey|RemoveKey|ChangeKey)) luks(Format|AddKey|RemoveKey|ChangeKey))
args=( $device ':key file:_files' ) args=( $device ':key file:_files' )
;; ;;
luksHeader*) args=( $device '--header-backup-file:file:_files' );; luksHeader*) args=( $device '--header-backup-file:file:_files' );;
*) *)
_default _default && ret=0
return
;; ;;
esac esac
_arguments $args && ret=0 _arguments $args && ret=0