#compdef pvsecret

autoload -U is-at-least

_pvsecret() {
    typeset -A opt_args
    typeset -a _arguments_options
    local ret=1

    if is-at-least 5.2; then
        _arguments_options=(-s -S -C)
    else
        _arguments_options=(-s -C)
    fi

    local context curcontext="$curcontext" state line
    _arguments "${_arguments_options[@]}" : \
'*-v[Provide more detailed output]' \
'*--verbose[Provide more detailed output]' \
'(-v --verbose)*-q[Provide less output]' \
'(-v --verbose)*--quiet[Provide less output]' \
'*-V[Provide more detailed output]' \
'--version[Print version information and exit]' \
'-h[Print help (see more with '\''--help'\'')]' \
'--help[Print help (see more with '\''--help'\'')]' \
":: :_pvsecret_commands" \
"*::: :->pvsecret" \
&& ret=0
    case $state in
    (pvsecret)
        words=($line[1] "${words[@]}")
        (( CURRENT += 1 ))
        curcontext="${curcontext%:*:*}:pvsecret-command-$line[1]:"
        case $line[1] in
            (create)
_arguments "${_arguments_options[@]}" : \
'*-k+[Use FILE as a host-key document]:FILE:_files' \
'*--host-key-document=[Use FILE as a host-key document]:FILE:_files' \
'*-C+[Use FILE as a certificate to verify the host-key or keys]:FILE:_files' \
'*--cert=[Use FILE as a certificate to verify the host-key or keys]:FILE:_files' \
'*--crl=[Use FILE as a certificate revocation list (CRL)]:FILE:_files' \
'--root-ca=[Use FILE as the root-CA certificate for the verification]:ROOT_CA:_files' \
'--hdr=[Specifies the header of the guest image]:FILE:_files' \
'-o+[Write the generated request to FILE]:FILE:_files' \
'--output=[Write the generated request to FILE]:FILE:_files' \
'--extension-secret=[Use the content of FILE as an extension secret]:FILE:_files' \
'--cck=[Use the content of FILE as the customer-communication key (CCK) to derive the extension secret]:FILE:_default' \
'--cuid-hex=[Use HEXSTRING as the Configuration Unique ID]:HEXSTRING:_default' \
'(--cuid-hex)--cuid=[Use the content of FILE as the Configuration Unique ID]:FILE:_files' \
'--pcf=[Manually set the add-secret request flags]:PCF:_default' \
'(--pcf)*--flags=[Flags for the add-secret request]:FLAGS:((disable-dump\:"Disables host-initiated dumping for the target guest instance"))' \
'--user-data=[Use the content of FILE as user-data]:FILE:_files' \
'--user-sign-key=[Use the content of FILE as user signing key]:FILE:_files' \
'--no-verify[Disable the host-key document verification]' \
'--offline[Make no attempt to download CRLs]' \
'-f[Force the generation of add-secret requests on IBM Secure Execution guests]' \
'--force[Force the generation of add-secret requests on IBM Secure Execution guests]' \
'--use-name[Do not hash the name, use it directly as secret ID]' \
'*-v[Provide more detailed output]' \
'*--verbose[Provide more detailed output]' \
'(-v --verbose)*-q[Provide less output]' \
'(-v --verbose)*--quiet[Provide less output]' \
'*-V[Provide more detailed output]' \
'-h[Print help (see more with '\''--help'\'')]' \
'--help[Print help (see more with '\''--help'\'')]' \
":: :_pvsecret__create_commands" \
"*::: :->create" \
&& ret=0

    case $state in
    (create)
        words=($line[1] "${words[@]}")
        (( CURRENT += 1 ))
        curcontext="${curcontext%:*:*}:pvsecret-create-command-$line[1]:"
        case $line[1] in
            (meta)
_arguments "${_arguments_options[@]}" : \
'*-v[Provide more detailed output]' \
'*--verbose[Provide more detailed output]' \
'(-v --verbose)*-q[Provide less output]' \
'(-v --verbose)*--quiet[Provide less output]' \
'*-V[Provide more detailed output]' \
'-h[Print help (see more with '\''--help'\'')]' \
'--help[Print help (see more with '\''--help'\'')]' \
&& ret=0
;;
(association)
_arguments "${_arguments_options[@]}" : \
'(--output-secret)--input-secret=[Path from which to read the plaintext secret. Uses a random secret if not specified]:SECRET-FILE:_files' \
'--output-secret=[Save the generated secret as plaintext in SECRET-FILE]:SECRET-FILE:_files' \
'--stdout[Print the hashed name to stdout]' \
'*-v[Provide more detailed output]' \
'*--verbose[Provide more detailed output]' \
'(-v --verbose)*-q[Provide less output]' \
'(-v --verbose)*--quiet[Provide less output]' \
'*-V[Provide more detailed output]' \
'-h[Print help (see more with '\''--help'\'')]' \
'--help[Print help (see more with '\''--help'\'')]' \
':name -- String that identifies the new secret:_default' \
&& ret=0
;;
(retrievable)
_arguments "${_arguments_options[@]}" : \
'--secret=[Use SECRET-FILE as retrievable secret]:SECRET-FILE:_files' \
'--type=[Specify the secret type]:TYPE:((plain\:"A plaintext secret. Can be any file up to 8190 bytes long"
aes\:"An AES key. Must be a plain byte file 128, 192, or 256 bit long"
aes-xts\:"An AES-XTS key. Must be a plain byte file 256, or 512 bit long"
hmac-sha\:"A HMAC-SHA key. Must be a plain byte file 512, or 1024 bit long. Special care is required when creating HMAC-SHA keys. For more Information refer to the DESCRIPTION section of the man file"
ec\:"An elliptic curve private key. Must be a PEM or DER file"))' \
'--stdout[Print the hashed name to stdout]' \
'*-v[Provide more detailed output]' \
'*--verbose[Provide more detailed output]' \
'(-v --verbose)*-q[Provide less output]' \
'(-v --verbose)*--quiet[Provide less output]' \
'*-V[Provide more detailed output]' \
'-h[Print help (see more with '\''--help'\'')]' \
'--help[Print help (see more with '\''--help'\'')]' \
':name -- String that identifies the new secret:_default' \
&& ret=0
;;
(retr)
_arguments "${_arguments_options[@]}" : \
'--secret=[Use SECRET-FILE as retrievable secret]:SECRET-FILE:_files' \
'--type=[Specify the secret type]:TYPE:((plain\:"A plaintext secret. Can be any file up to 8190 bytes long"
aes\:"An AES key. Must be a plain byte file 128, 192, or 256 bit long"
aes-xts\:"An AES-XTS key. Must be a plain byte file 256, or 512 bit long"
hmac-sha\:"A HMAC-SHA key. Must be a plain byte file 512, or 1024 bit long. Special care is required when creating HMAC-SHA keys. For more Information refer to the DESCRIPTION section of the man file"
ec\:"An elliptic curve private key. Must be a PEM or DER file"))' \
'--stdout[Print the hashed name to stdout]' \
'*-v[Provide more detailed output]' \
'*--verbose[Provide more detailed output]' \
'(-v --verbose)*-q[Provide less output]' \
'(-v --verbose)*--quiet[Provide less output]' \
'*-V[Provide more detailed output]' \
'-h[Print help (see more with '\''--help'\'')]' \
'--help[Print help (see more with '\''--help'\'')]' \
':name -- String that identifies the new secret:_default' \
&& ret=0
;;
(update-cck)
_arguments "${_arguments_options[@]}" : \
'--secret=[Use CCK-FILE as new CCK]:CCK-FILE:_files' \
'*-v[Provide more detailed output]' \
'*--verbose[Provide more detailed output]' \
'(-v --verbose)*-q[Provide less output]' \
'(-v --verbose)*--quiet[Provide less output]' \
'*-V[Provide more detailed output]' \
'-h[Print help (see more with '\''--help'\'')]' \
'--help[Print help (see more with '\''--help'\'')]' \
&& ret=0
;;
(cck)
_arguments "${_arguments_options[@]}" : \
'--secret=[Use CCK-FILE as new CCK]:CCK-FILE:_files' \
'*-v[Provide more detailed output]' \
'*--verbose[Provide more detailed output]' \
'(-v --verbose)*-q[Provide less output]' \
'(-v --verbose)*--quiet[Provide less output]' \
'*-V[Provide more detailed output]' \
'-h[Print help (see more with '\''--help'\'')]' \
'--help[Print help (see more with '\''--help'\'')]' \
&& ret=0
;;
(help)
_arguments "${_arguments_options[@]}" : \
":: :_pvsecret__create__help_commands" \
"*::: :->help" \
&& ret=0

    case $state in
    (help)
        words=($line[1] "${words[@]}")
        (( CURRENT += 1 ))
        curcontext="${curcontext%:*:*}:pvsecret-create-help-command-$line[1]:"
        case $line[1] in
            (meta)
_arguments "${_arguments_options[@]}" : \
&& ret=0
;;
(association)
_arguments "${_arguments_options[@]}" : \
&& ret=0
;;
(retrievable)
_arguments "${_arguments_options[@]}" : \
&& ret=0
;;
(update-cck)
_arguments "${_arguments_options[@]}" : \
&& ret=0
;;
(help)
_arguments "${_arguments_options[@]}" : \
&& ret=0
;;
        esac
    ;;
esac
;;
        esac
    ;;
esac
;;
(add)
_arguments "${_arguments_options[@]}" : \
'-f[Force the addition of add-secret requests]' \
'--force[Force the addition of add-secret requests]' \
'*-v[Provide more detailed output]' \
'*--verbose[Provide more detailed output]' \
'(-v --verbose)*-q[Provide less output]' \
'(-v --verbose)*--quiet[Provide less output]' \
'*-V[Provide more detailed output]' \
'-h[Print help (see more with '\''--help'\'')]' \
'--help[Print help (see more with '\''--help'\'')]' \
':input -- Specify the request to be sent:_files' \
&& ret=0
;;
(lock)
_arguments "${_arguments_options[@]}" : \
'*-v[Provide more detailed output]' \
'*--verbose[Provide more detailed output]' \
'(-v --verbose)*-q[Provide less output]' \
'(-v --verbose)*--quiet[Provide less output]' \
'*-V[Provide more detailed output]' \
'-h[Print help (see more with '\''--help'\'')]' \
'--help[Print help (see more with '\''--help'\'')]' \
&& ret=0
;;
(list)
_arguments "${_arguments_options[@]}" : \
'--format=[Define the output format of the list]:FORMAT:((human\:"Human-focused, non-parsable output format"
yaml\:"Use yaml format"
bin\:"Use the format the ultravisor uses to pass the list"))' \
'*-v[Provide more detailed output]' \
'*--verbose[Provide more detailed output]' \
'(-v --verbose)*-q[Provide less output]' \
'(-v --verbose)*--quiet[Provide less output]' \
'*-V[Provide more detailed output]' \
'-h[Print help (see more with '\''--help'\'')]' \
'--help[Print help (see more with '\''--help'\'')]' \
'::output -- Store the result in FILE:_files' \
&& ret=0
;;
(verify)
_arguments "${_arguments_options[@]}" : \
'--user-cert=[Certificate containing a public key used to verify the user data signature]:FILE:_files' \
'-o+[Store the result in FILE]:FILE:_files' \
'--output=[Store the result in FILE]:FILE:_files' \
'*-v[Provide more detailed output]' \
'*--verbose[Provide more detailed output]' \
'(-v --verbose)*-q[Provide less output]' \
'(-v --verbose)*--quiet[Provide less output]' \
'*-V[Provide more detailed output]' \
'-h[Print help (see more with '\''--help'\'')]' \
'--help[Print help (see more with '\''--help'\'')]' \
':input -- Specify the request to be checked:_files' \
&& ret=0
;;
(retrieve)
_arguments "${_arguments_options[@]}" : \
'-o+[Specify the output path to place the secret value]:FILE:_files' \
'--output=[Specify the output path to place the secret value]:FILE:_files' \
'--inform=[Define input type for the Secret ID]:INFORM:((yaml\:"Use a yaml file"
hex\:"Use a hex string"
name\:"Use a name-string. Will hash it if no secret with the name found"
idx\:"Use the secret-index (base 10) instead of the secret-ID"))' \
'--outform=[Define the output format for the retrieved secret]:OUTFORM:((pem\:"Write the secret as PEM"
bin\:"Write the secret in binary"))' \
'*-v[Provide more detailed output]' \
'*--verbose[Provide more detailed output]' \
'(-v --verbose)*-q[Provide less output]' \
'(-v --verbose)*--quiet[Provide less output]' \
'*-V[Provide more detailed output]' \
'-h[Print help (see more with '\''--help'\'')]' \
'--help[Print help (see more with '\''--help'\'')]' \
':input -- Specify the secret ID to be retrieved:_files' \
&& ret=0
;;
(retr)
_arguments "${_arguments_options[@]}" : \
'-o+[Specify the output path to place the secret value]:FILE:_files' \
'--output=[Specify the output path to place the secret value]:FILE:_files' \
'--inform=[Define input type for the Secret ID]:INFORM:((yaml\:"Use a yaml file"
hex\:"Use a hex string"
name\:"Use a name-string. Will hash it if no secret with the name found"
idx\:"Use the secret-index (base 10) instead of the secret-ID"))' \
'--outform=[Define the output format for the retrieved secret]:OUTFORM:((pem\:"Write the secret as PEM"
bin\:"Write the secret in binary"))' \
'*-v[Provide more detailed output]' \
'*--verbose[Provide more detailed output]' \
'(-v --verbose)*-q[Provide less output]' \
'(-v --verbose)*--quiet[Provide less output]' \
'*-V[Provide more detailed output]' \
'-h[Print help (see more with '\''--help'\'')]' \
'--help[Print help (see more with '\''--help'\'')]' \
':input -- Specify the secret ID to be retrieved:_files' \
&& ret=0
;;
(version)
_arguments "${_arguments_options[@]}" : \
'*-v[Provide more detailed output]' \
'*--verbose[Provide more detailed output]' \
'(-v --verbose)*-q[Provide less output]' \
'(-v --verbose)*--quiet[Provide less output]' \
'*-V[Provide more detailed output]' \
'-h[Print help]' \
'--help[Print help]' \
&& ret=0
;;
(help)
_arguments "${_arguments_options[@]}" : \
":: :_pvsecret__help_commands" \
"*::: :->help" \
&& ret=0

    case $state in
    (help)
        words=($line[1] "${words[@]}")
        (( CURRENT += 1 ))
        curcontext="${curcontext%:*:*}:pvsecret-help-command-$line[1]:"
        case $line[1] in
            (create)
_arguments "${_arguments_options[@]}" : \
":: :_pvsecret__help__create_commands" \
"*::: :->create" \
&& ret=0

    case $state in
    (create)
        words=($line[1] "${words[@]}")
        (( CURRENT += 1 ))
        curcontext="${curcontext%:*:*}:pvsecret-help-create-command-$line[1]:"
        case $line[1] in
            (meta)
_arguments "${_arguments_options[@]}" : \
&& ret=0
;;
(association)
_arguments "${_arguments_options[@]}" : \
&& ret=0
;;
(retrievable)
_arguments "${_arguments_options[@]}" : \
&& ret=0
;;
(update-cck)
_arguments "${_arguments_options[@]}" : \
&& ret=0
;;
        esac
    ;;
esac
;;
(add)
_arguments "${_arguments_options[@]}" : \
&& ret=0
;;
(lock)
_arguments "${_arguments_options[@]}" : \
&& ret=0
;;
(list)
_arguments "${_arguments_options[@]}" : \
&& ret=0
;;
(verify)
_arguments "${_arguments_options[@]}" : \
&& ret=0
;;
(retrieve)
_arguments "${_arguments_options[@]}" : \
&& ret=0
;;
(version)
_arguments "${_arguments_options[@]}" : \
&& ret=0
;;
(help)
_arguments "${_arguments_options[@]}" : \
&& ret=0
;;
        esac
    ;;
esac
;;
        esac
    ;;
esac
}

(( $+functions[_pvsecret_commands] )) ||
_pvsecret_commands() {
    local commands; commands=(
'create:Create a new add-secret request' \
'add:Submit an add-secret request to the Ultravisor (s390x only)' \
'lock:Lock the secret-store (s390x only)' \
'list:List all ultravisor secrets (s390x only)' \
'verify:Verify that an add-secret request is sane' \
'retrieve:Retrieve a secret from the UV secret store (s390x only)' \
'retr:Retrieve a secret from the UV secret store (s390x only)' \
'version:Print version information and exit' \
'help:Print this message or the help of the given subcommand(s)' \
    )
    _describe -t commands 'pvsecret commands' commands "$@"
}
(( $+functions[_pvsecret__add_commands] )) ||
_pvsecret__add_commands() {
    local commands; commands=()
    _describe -t commands 'pvsecret add commands' commands "$@"
}
(( $+functions[_pvsecret__create_commands] )) ||
_pvsecret__create_commands() {
    local commands; commands=(
'meta:Create a meta secret' \
'association:Create an association secret' \
'retrievable:Create a retrievable secret' \
'retr:Create a retrievable secret' \
'update-cck:Update customer communication key' \
'cck:Update customer communication key' \
'help:Print this message or the help of the given subcommand(s)' \
    )
    _describe -t commands 'pvsecret create commands' commands "$@"
}
(( $+functions[_pvsecret__create__association_commands] )) ||
_pvsecret__create__association_commands() {
    local commands; commands=()
    _describe -t commands 'pvsecret create association commands' commands "$@"
}
(( $+functions[_pvsecret__create__help_commands] )) ||
_pvsecret__create__help_commands() {
    local commands; commands=(
'meta:Create a meta secret' \
'association:Create an association secret' \
'retrievable:Create a retrievable secret' \
'update-cck:Update customer communication key' \
'help:Print this message or the help of the given subcommand(s)' \
    )
    _describe -t commands 'pvsecret create help commands' commands "$@"
}
(( $+functions[_pvsecret__create__help__association_commands] )) ||
_pvsecret__create__help__association_commands() {
    local commands; commands=()
    _describe -t commands 'pvsecret create help association commands' commands "$@"
}
(( $+functions[_pvsecret__create__help__help_commands] )) ||
_pvsecret__create__help__help_commands() {
    local commands; commands=()
    _describe -t commands 'pvsecret create help help commands' commands "$@"
}
(( $+functions[_pvsecret__create__help__meta_commands] )) ||
_pvsecret__create__help__meta_commands() {
    local commands; commands=()
    _describe -t commands 'pvsecret create help meta commands' commands "$@"
}
(( $+functions[_pvsecret__create__help__retrievable_commands] )) ||
_pvsecret__create__help__retrievable_commands() {
    local commands; commands=()
    _describe -t commands 'pvsecret create help retrievable commands' commands "$@"
}
(( $+functions[_pvsecret__create__help__update-cck_commands] )) ||
_pvsecret__create__help__update-cck_commands() {
    local commands; commands=()
    _describe -t commands 'pvsecret create help update-cck commands' commands "$@"
}
(( $+functions[_pvsecret__create__meta_commands] )) ||
_pvsecret__create__meta_commands() {
    local commands; commands=()
    _describe -t commands 'pvsecret create meta commands' commands "$@"
}
(( $+functions[_pvsecret__create__retrievable_commands] )) ||
_pvsecret__create__retrievable_commands() {
    local commands; commands=()
    _describe -t commands 'pvsecret create retrievable commands' commands "$@"
}
(( $+functions[_pvsecret__create__update-cck_commands] )) ||
_pvsecret__create__update-cck_commands() {
    local commands; commands=()
    _describe -t commands 'pvsecret create update-cck commands' commands "$@"
}
(( $+functions[_pvsecret__help_commands] )) ||
_pvsecret__help_commands() {
    local commands; commands=(
'create:Create a new add-secret request' \
'add:Submit an add-secret request to the Ultravisor (s390x only)' \
'lock:Lock the secret-store (s390x only)' \
'list:List all ultravisor secrets (s390x only)' \
'verify:Verify that an add-secret request is sane' \
'retrieve:Retrieve a secret from the UV secret store (s390x only)' \
'version:Print version information and exit' \
'help:Print this message or the help of the given subcommand(s)' \
    )
    _describe -t commands 'pvsecret help commands' commands "$@"
}
(( $+functions[_pvsecret__help__add_commands] )) ||
_pvsecret__help__add_commands() {
    local commands; commands=()
    _describe -t commands 'pvsecret help add commands' commands "$@"
}
(( $+functions[_pvsecret__help__create_commands] )) ||
_pvsecret__help__create_commands() {
    local commands; commands=(
'meta:Create a meta secret' \
'association:Create an association secret' \
'retrievable:Create a retrievable secret' \
'update-cck:Update customer communication key' \
    )
    _describe -t commands 'pvsecret help create commands' commands "$@"
}
(( $+functions[_pvsecret__help__create__association_commands] )) ||
_pvsecret__help__create__association_commands() {
    local commands; commands=()
    _describe -t commands 'pvsecret help create association commands' commands "$@"
}
(( $+functions[_pvsecret__help__create__meta_commands] )) ||
_pvsecret__help__create__meta_commands() {
    local commands; commands=()
    _describe -t commands 'pvsecret help create meta commands' commands "$@"
}
(( $+functions[_pvsecret__help__create__retrievable_commands] )) ||
_pvsecret__help__create__retrievable_commands() {
    local commands; commands=()
    _describe -t commands 'pvsecret help create retrievable commands' commands "$@"
}
(( $+functions[_pvsecret__help__create__update-cck_commands] )) ||
_pvsecret__help__create__update-cck_commands() {
    local commands; commands=()
    _describe -t commands 'pvsecret help create update-cck commands' commands "$@"
}
(( $+functions[_pvsecret__help__help_commands] )) ||
_pvsecret__help__help_commands() {
    local commands; commands=()
    _describe -t commands 'pvsecret help help commands' commands "$@"
}
(( $+functions[_pvsecret__help__list_commands] )) ||
_pvsecret__help__list_commands() {
    local commands; commands=()
    _describe -t commands 'pvsecret help list commands' commands "$@"
}
(( $+functions[_pvsecret__help__lock_commands] )) ||
_pvsecret__help__lock_commands() {
    local commands; commands=()
    _describe -t commands 'pvsecret help lock commands' commands "$@"
}
(( $+functions[_pvsecret__help__retrieve_commands] )) ||
_pvsecret__help__retrieve_commands() {
    local commands; commands=()
    _describe -t commands 'pvsecret help retrieve commands' commands "$@"
}
(( $+functions[_pvsecret__help__verify_commands] )) ||
_pvsecret__help__verify_commands() {
    local commands; commands=()
    _describe -t commands 'pvsecret help verify commands' commands "$@"
}
(( $+functions[_pvsecret__help__version_commands] )) ||
_pvsecret__help__version_commands() {
    local commands; commands=()
    _describe -t commands 'pvsecret help version commands' commands "$@"
}
(( $+functions[_pvsecret__list_commands] )) ||
_pvsecret__list_commands() {
    local commands; commands=()
    _describe -t commands 'pvsecret list commands' commands "$@"
}
(( $+functions[_pvsecret__lock_commands] )) ||
_pvsecret__lock_commands() {
    local commands; commands=()
    _describe -t commands 'pvsecret lock commands' commands "$@"
}
(( $+functions[_pvsecret__retrieve_commands] )) ||
_pvsecret__retrieve_commands() {
    local commands; commands=()
    _describe -t commands 'pvsecret retrieve commands' commands "$@"
}
(( $+functions[_pvsecret__verify_commands] )) ||
_pvsecret__verify_commands() {
    local commands; commands=()
    _describe -t commands 'pvsecret verify commands' commands "$@"
}
(( $+functions[_pvsecret__version_commands] )) ||
_pvsecret__version_commands() {
    local commands; commands=()
    _describe -t commands 'pvsecret version commands' commands "$@"
}

if [ "$funcstack[1]" = "_pvsecret" ]; then
    _pvsecret "$@"
else
    compdef _pvsecret pvsecret
fi
