#compdef genprotimg

autoload -U is-at-least

_genprotimg() {
    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[@]}" : \
'-i+[Use the content of FILE as a raw binary Linux kernel]:FILE:_files' \
'--kernel=[Use the content of FILE as a raw binary Linux kernel]:FILE:_files' \
'--image=[Use the content of FILE as a raw binary Linux kernel]:FILE:_files' \
'-r+[Use the content of FILE as the Linux initial RAM disk]:FILE:_files' \
'--ramdisk=[Use the content of FILE as the Linux initial RAM disk]:FILE:_files' \
'-p+[Use the content of FILE as the Linux kernel command line]:FILE:_files' \
'--parmfile=[Use the content of FILE as the Linux kernel command line]:FILE:_files' \
'-o+[Write the generated Secure Execution boot image to FILE]:FILE:_files' \
'--output=[Write the generated Secure Execution boot image to FILE]:FILE:_files' \
'*-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' \
'--cck=[Use the content of FILE as the customer-communication key (CCK)]:FILE:_files' \
'--comm-key=[Use the content of FILE as the customer-communication key (CCK)]:FILE:_files' \
'--hdr-key=[Use the content of FILE as the Secure Execution header protection key]:FILE:_files' \
'--x-bootloader-directory=[Manually set the directory used to load the Secure Execution bootloaders (stage3a and stage3b) (experimental option)]:DIR:_files' \
'--x-comp-key=[Manually set the image components encryption key (experimental option)]:FILE:_files' \
'--x-psw=[Manually set the PSW address used for the Secure Execution header (experimental option)]:ADDRESS:_default' \
'--x-pcf=[Manually set the plaintext control flags (experimental option)]:PCF:_default' \
'--x-scf=[Manually set the secret control flags (experimental option)]:SCF:_default' \
'--no-verify[Disable the host-key document verification]' \
'--offline[Make no attempt to download CRLs]' \
'--no-component-check[Disable all input component checks]' \
'--overwrite[Overwrite an existing Secure Execution boot image]' \
'--enable-dump[Enable Secure Execution guest dump support. This option requires the '\''--cck'\'' or '\''--enable-cck-update'\'' option]' \
'(--enable-dump)--disable-dump[Disable Secure Execution guest dump support (default)]' \
'--enable-cck-extension-secret[Add-secret requests must provide an extension secret that matches the CCK-derived extension secret. This option requires the '\''--cck'\'' option]' \
'(--enable-cck-extension-secret)--disable-cck-extension-secret[Add-secret requests don'\''t have to provide the CCK-derived extension secret (default)]' \
'(--enable-cck-extension-secret)--enable-cck-update[Enable CCK update support. Requires z17 or up. This option cannot be used in conjunction with the '\''--enable-cck-extension-secret'\'' option]' \
'(--enable-cck-update)--disable-cck-update[Disable CCK update support (default)]' \
'--enable-pckmo[Enable the support for the DEA, TDEA, AES, and ECC PCKMO key encryption functions (default)]' \
'(--enable-pckmo)--disable-pckmo[Disable the support for the DEA, TDEA, AES, and ECC PCKMO key encryption functions]' \
'--enable-pckmo-hmac[Enable the support for the HMAC PCKMO key encryption function]' \
'(--enable-pckmo-hmac)--disable-pckmo-hmac[Disable the support for the HMAC PCKMO key encryption function (default)]' \
'--enable-backup-keys[Enable the support for backup target keys]' \
'(--enable-backup-keys)--disable-backup-keys[Disable the support for backup target keys (default)]' \
'--enable-image-encryption[Enable encryption of the image components (default)]' \
'(--enable-image-encryption)--disable-image-encryption[Disable encryption of the image components]' \
'*-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]' \
'--help-all[Print help (deprecated, use '\''--help'\'' instead)]' \
'--help-experimental[Print help (deprecated, use '\''--help'\'' instead)]' \
'-h[Print help (see more with '\''--help'\'')]' \
'--help[Print help (see more with '\''--help'\'')]' \
&& ret=0
}

(( $+functions[_genprotimg_commands] )) ||
_genprotimg_commands() {
    local commands; commands=()
    _describe -t commands 'genprotimg commands' commands "$@"
}

if [ "$funcstack[1]" = "_genprotimg" ]; then
    _genprotimg "$@"
else
    compdef _genprotimg genprotimg
fi
