diff options
| author | Daniel Friesel <derf@derf.homelinux.org> | 2009-03-14 16:48:36 +0100 | 
|---|---|---|
| committer | Daniel Friesel <derf@derf.homelinux.org> | 2009-03-14 16:48:36 +0100 | 
| commit | c29f75255946f5fceea57936f92b3b72c0032436 (patch) | |
| tree | a2e6f2603351044867e41c3d240227f573ce7276 /etc | |
| parent | f88935760f6be5849c7890a4e7552715105a80ee (diff) | |
cryptsetup completion: Added arguments (does not work yet, though)
Diffstat (limited to 'etc')
| -rw-r--r-- | etc/completions/_cryptsetup | 25 | 
1 files changed, 24 insertions, 1 deletions
diff --git a/etc/completions/_cryptsetup b/etc/completions/_cryptsetup index 3d34bef..4a28068 100644 --- a/etc/completions/_cryptsetup +++ b/etc/completions/_cryptsetup @@ -9,6 +9,28 @@ function _cryptsetup_action {  	isLuks  } +function _cryptsetup_device { +	_files +} + +function _cryptsetup_mapping { +	_path_files -W /dev/mapper +} + +function _cryptsetup_arguments { +	if (( CURRENT == 2 )) { +		case $word[1] in +			create|remove|status|resize) _cryptsetup_mapping ;; +			luks(Format|Open|AddKey|RemoveKey|KillSlot|DelKey|UUID|Dump)|isLuks) _cryptsetup_device ;; +		esac +	} elif (( CURRNT == 3 )) { +		case $word[1] in +			create) _cryptsetup_device ;; +			luksOpen) _cryptsetup_mapping ;; +		esac +	} +} +  _arguments -n \  	{-h,--hash}':hash' \  	{-c,--cipher}':cipher specification' \ @@ -25,4 +47,5 @@ _arguments -n \  	{-t,--timeout}':password timeout (seconds)' \  	{-T,--tries}':passwort retries' \  	'--align-payload=-:payload boundary align (512-byte sectors)' \ -	':action:_cryptsetup_action' +	':action:_cryptsetup_action' \ +	':arguments::_cryptsetup_arguments'  | 
