diff options
author | David Paleino <dapal@debian.org> | 2011-11-03 12:32:52 +0100 |
---|---|---|
committer | David Paleino <dapal@debian.org> | 2011-11-03 12:32:52 +0100 |
commit | 2c8171c38d87ddef31c92a76547d3fdf773a1337 (patch) | |
tree | 5e720d5a06ead72ed55454bf6647a712a761ed91 /completions/cryptsetup | |
parent | 9920a8faedf704420571d8072ccab27e9dac40ba (diff) | |
download | bash-completion-2c8171c38d87ddef31c92a76547d3fdf773a1337.tar.gz |
Imported Upstream version 1.90upstream/1.90
Diffstat (limited to 'completions/cryptsetup')
-rw-r--r-- | completions/cryptsetup | 27 |
1 files changed, 10 insertions, 17 deletions
diff --git a/completions/cryptsetup b/completions/cryptsetup index 5e88de34..2bbdc952 100644 --- a/completions/cryptsetup +++ b/completions/cryptsetup @@ -1,4 +1,4 @@ -# bash completion for cryptsetup +# bash completion for cryptsetup -*- shell-script -*- _cryptsetup_name() { @@ -12,28 +12,26 @@ _cryptsetup_device() _filedir } -have cryptsetup && _cryptsetup() { - local cur prev arg - COMPREPLY=() - cur=`_get_cword` - prev=`_get_pword` + local cur prev words cword split + _init_completion -s || return case $prev in --key-file|--master-key-file|--header-backup-file|-d) _filedir - return 0; + return 0 ;; esac + $split && return + + local arg _get_first_arg if [ -z $arg ]; then if [[ "$cur" == -* ]]; then - COMPREPLY=( $( compgen -W '--hash --cipher --verify-passphrase \ - --key-file --master-key-file --key-slot --key-size --size \ - --offset --skip --readonly --iter-time --batch-mode --timeout \ - --tries --align-payload --version' -- "$cur" ) ) + COMPREPLY=( $( compgen -W '$( _parse_help "$1" )' -- "$cur" ) ) + [[ $COMPREPLY == *= ]] && compopt -o nospace else COMPREPLY=( $( compgen -W 'create remove status resize luksFormat \ luksOpen luksClose luksSuspend luksResume luksAddKey \ @@ -41,6 +39,7 @@ _cryptsetup() luksDump luksHeaderBackup luksHeaderRestore' -- "$cur" ) ) fi else + local args _count_args case $arg in create) @@ -104,10 +103,4 @@ _cryptsetup() } && complete -F _cryptsetup cryptsetup -# Local variables: -# mode: shell-script -# sh-basic-offset: 4 -# sh-indent-comment: t -# indent-tabs-mode: nil -# End: # ex: ts=4 sw=4 et filetype=sh |