#compdef jade

autoload -U is-at-least

_jade() {
    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[@]}" : \
'--mount-point=[root directory]:MOUNT_POINT:_files' \
'*-v[]' \
'*--verbose[]' \
'-h[Print help]' \
'--help[Print help]' \
'-V[Print version]' \
'--version[Print version]' \
":: :_jade_commands" \
"*::: :->jade" \
&& ret=0
    case $state in
    (jade)
        words=($line[1] "${words[@]}")
        (( CURRENT += 1 ))
        curcontext="${curcontext%:*:*}:jade-command-$line[1]:"
        case $line[1] in
            (config)
_arguments "${_arguments_options[@]}" : \
'-h[Print help]' \
'--help[Print help]' \
':config:_files' \
&& ret=0
;;
(partition)
_arguments "${_arguments_options[@]}" : \
'--mode=[]:MODE:(auto manual)' \
'--device=[]:DEVICE:_files' \
'--efi[]' \
'-h[Print help]' \
'--help[Print help]' \
'*::partitions:_default' \
&& ret=0
;;
(install-base)
_arguments "${_arguments_options[@]}" : \
'--kernel=[]:KERNEL:_default' \
'-h[Print help]' \
'--help[Print help]' \
&& ret=0
;;
(genfstab)
_arguments "${_arguments_options[@]}" : \
'-h[Print help]' \
'--help[Print help]' \
&& ret=0
;;
(bootloader)
_arguments "${_arguments_options[@]}" : \
'--loader-type=[]:LOADER_TYPE:_default' \
'--device=[]:DEVICE:_files' \
'--removable[]' \
'-h[Print help]' \
'--help[Print help]' \
&& ret=0
;;
(locale)
_arguments "${_arguments_options[@]}" : \
'--keyboard=[]:KEYBOARD:_default' \
'--timezone=[]:TIMEZONE:_default' \
'-h[Print help]' \
'--help[Print help]' \
'*::locales:_default' \
&& ret=0
;;
(networking)
_arguments "${_arguments_options[@]}" : \
'-h[Print help]' \
'--help[Print help]' \
'::hostname:_default' \
&& ret=0
;;
(users)
_arguments "${_arguments_options[@]}" : \
'-h[Print help]' \
'--help[Print help]' \
":: :_jade__users_commands" \
"*::: :->users" \
&& ret=0

    case $state in
    (users)
        words=($line[1] "${words[@]}")
        (( CURRENT += 1 ))
        curcontext="${curcontext%:*:*}:jade-users-command-$line[1]:"
        case $line[1] in
            (new-user)
_arguments "${_arguments_options[@]}" : \
'--shell=[]:SHELL:_default' \
'--hasroot[]' \
'-h[Print help]' \
'--help[Print help]' \
':username:_default' \
':password:_default' \
&& ret=0
;;
(root-password)
_arguments "${_arguments_options[@]}" : \
'-h[Print help]' \
'--help[Print help]' \
':password:_default' \
&& ret=0
;;
(help)
_arguments "${_arguments_options[@]}" : \
":: :_jade__users__help_commands" \
"*::: :->help" \
&& ret=0

    case $state in
    (help)
        words=($line[1] "${words[@]}")
        (( CURRENT += 1 ))
        curcontext="${curcontext%:*:*}:jade-users-help-command-$line[1]:"
        case $line[1] in
            (new-user)
_arguments "${_arguments_options[@]}" : \
&& ret=0
;;
(root-password)
_arguments "${_arguments_options[@]}" : \
&& ret=0
;;
(help)
_arguments "${_arguments_options[@]}" : \
&& ret=0
;;
        esac
    ;;
esac
;;
        esac
    ;;
esac
;;
(flatpak)
_arguments "${_arguments_options[@]}" : \
'-h[Print help]' \
'--help[Print help]' \
&& ret=0
;;
(desktops)
_arguments "${_arguments_options[@]}" : \
'-h[Print help]' \
'--help[Print help]' \
'::desktop:_default' \
&& ret=0
;;
(completions)
_arguments "${_arguments_options[@]}" : \
'-h[Print help]' \
'--help[Print help]' \
':shell:(bash elvish fish powershell zsh)' \
&& ret=0
;;
(help)
_arguments "${_arguments_options[@]}" : \
":: :_jade__help_commands" \
"*::: :->help" \
&& ret=0

    case $state in
    (help)
        words=($line[1] "${words[@]}")
        (( CURRENT += 1 ))
        curcontext="${curcontext%:*:*}:jade-help-command-$line[1]:"
        case $line[1] in
            (config)
_arguments "${_arguments_options[@]}" : \
&& ret=0
;;
(partition)
_arguments "${_arguments_options[@]}" : \
&& ret=0
;;
(install-base)
_arguments "${_arguments_options[@]}" : \
&& ret=0
;;
(genfstab)
_arguments "${_arguments_options[@]}" : \
&& ret=0
;;
(bootloader)
_arguments "${_arguments_options[@]}" : \
&& ret=0
;;
(locale)
_arguments "${_arguments_options[@]}" : \
&& ret=0
;;
(networking)
_arguments "${_arguments_options[@]}" : \
&& ret=0
;;
(users)
_arguments "${_arguments_options[@]}" : \
":: :_jade__help__users_commands" \
"*::: :->users" \
&& ret=0

    case $state in
    (users)
        words=($line[1] "${words[@]}")
        (( CURRENT += 1 ))
        curcontext="${curcontext%:*:*}:jade-help-users-command-$line[1]:"
        case $line[1] in
            (new-user)
_arguments "${_arguments_options[@]}" : \
&& ret=0
;;
(root-password)
_arguments "${_arguments_options[@]}" : \
&& ret=0
;;
        esac
    ;;
esac
;;
(flatpak)
_arguments "${_arguments_options[@]}" : \
&& ret=0
;;
(desktops)
_arguments "${_arguments_options[@]}" : \
&& ret=0
;;
(completions)
_arguments "${_arguments_options[@]}" : \
&& ret=0
;;
(help)
_arguments "${_arguments_options[@]}" : \
&& ret=0
;;
        esac
    ;;
esac
;;
        esac
    ;;
esac
}

(( $+functions[_jade_commands] )) ||
_jade_commands() {
    local commands; commands=(
'config:' \
'partition:' \
'install-base:' \
'genfstab:' \
'bootloader:' \
'locale:' \
'networking:' \
'users:' \
'flatpak:' \
'desktops:' \
'completions:' \
'help:Print this message or the help of the given subcommand(s)' \
    )
    _describe -t commands 'jade commands' commands "$@"
}
(( $+functions[_jade__bootloader_commands] )) ||
_jade__bootloader_commands() {
    local commands; commands=()
    _describe -t commands 'jade bootloader commands' commands "$@"
}
(( $+functions[_jade__completions_commands] )) ||
_jade__completions_commands() {
    local commands; commands=()
    _describe -t commands 'jade completions commands' commands "$@"
}
(( $+functions[_jade__config_commands] )) ||
_jade__config_commands() {
    local commands; commands=()
    _describe -t commands 'jade config commands' commands "$@"
}
(( $+functions[_jade__desktops_commands] )) ||
_jade__desktops_commands() {
    local commands; commands=()
    _describe -t commands 'jade desktops commands' commands "$@"
}
(( $+functions[_jade__flatpak_commands] )) ||
_jade__flatpak_commands() {
    local commands; commands=()
    _describe -t commands 'jade flatpak commands' commands "$@"
}
(( $+functions[_jade__genfstab_commands] )) ||
_jade__genfstab_commands() {
    local commands; commands=()
    _describe -t commands 'jade genfstab commands' commands "$@"
}
(( $+functions[_jade__help_commands] )) ||
_jade__help_commands() {
    local commands; commands=(
'config:' \
'partition:' \
'install-base:' \
'genfstab:' \
'bootloader:' \
'locale:' \
'networking:' \
'users:' \
'flatpak:' \
'desktops:' \
'completions:' \
'help:Print this message or the help of the given subcommand(s)' \
    )
    _describe -t commands 'jade help commands' commands "$@"
}
(( $+functions[_jade__help__bootloader_commands] )) ||
_jade__help__bootloader_commands() {
    local commands; commands=()
    _describe -t commands 'jade help bootloader commands' commands "$@"
}
(( $+functions[_jade__help__completions_commands] )) ||
_jade__help__completions_commands() {
    local commands; commands=()
    _describe -t commands 'jade help completions commands' commands "$@"
}
(( $+functions[_jade__help__config_commands] )) ||
_jade__help__config_commands() {
    local commands; commands=()
    _describe -t commands 'jade help config commands' commands "$@"
}
(( $+functions[_jade__help__desktops_commands] )) ||
_jade__help__desktops_commands() {
    local commands; commands=()
    _describe -t commands 'jade help desktops commands' commands "$@"
}
(( $+functions[_jade__help__flatpak_commands] )) ||
_jade__help__flatpak_commands() {
    local commands; commands=()
    _describe -t commands 'jade help flatpak commands' commands "$@"
}
(( $+functions[_jade__help__genfstab_commands] )) ||
_jade__help__genfstab_commands() {
    local commands; commands=()
    _describe -t commands 'jade help genfstab commands' commands "$@"
}
(( $+functions[_jade__help__help_commands] )) ||
_jade__help__help_commands() {
    local commands; commands=()
    _describe -t commands 'jade help help commands' commands "$@"
}
(( $+functions[_jade__help__install-base_commands] )) ||
_jade__help__install-base_commands() {
    local commands; commands=()
    _describe -t commands 'jade help install-base commands' commands "$@"
}
(( $+functions[_jade__help__locale_commands] )) ||
_jade__help__locale_commands() {
    local commands; commands=()
    _describe -t commands 'jade help locale commands' commands "$@"
}
(( $+functions[_jade__help__networking_commands] )) ||
_jade__help__networking_commands() {
    local commands; commands=()
    _describe -t commands 'jade help networking commands' commands "$@"
}
(( $+functions[_jade__help__partition_commands] )) ||
_jade__help__partition_commands() {
    local commands; commands=()
    _describe -t commands 'jade help partition commands' commands "$@"
}
(( $+functions[_jade__help__users_commands] )) ||
_jade__help__users_commands() {
    local commands; commands=(
'new-user:' \
'root-password:' \
    )
    _describe -t commands 'jade help users commands' commands "$@"
}
(( $+functions[_jade__help__users__new-user_commands] )) ||
_jade__help__users__new-user_commands() {
    local commands; commands=()
    _describe -t commands 'jade help users new-user commands' commands "$@"
}
(( $+functions[_jade__help__users__root-password_commands] )) ||
_jade__help__users__root-password_commands() {
    local commands; commands=()
    _describe -t commands 'jade help users root-password commands' commands "$@"
}
(( $+functions[_jade__install-base_commands] )) ||
_jade__install-base_commands() {
    local commands; commands=()
    _describe -t commands 'jade install-base commands' commands "$@"
}
(( $+functions[_jade__locale_commands] )) ||
_jade__locale_commands() {
    local commands; commands=()
    _describe -t commands 'jade locale commands' commands "$@"
}
(( $+functions[_jade__networking_commands] )) ||
_jade__networking_commands() {
    local commands; commands=()
    _describe -t commands 'jade networking commands' commands "$@"
}
(( $+functions[_jade__partition_commands] )) ||
_jade__partition_commands() {
    local commands; commands=()
    _describe -t commands 'jade partition commands' commands "$@"
}
(( $+functions[_jade__users_commands] )) ||
_jade__users_commands() {
    local commands; commands=(
'new-user:' \
'root-password:' \
'help:Print this message or the help of the given subcommand(s)' \
    )
    _describe -t commands 'jade users commands' commands "$@"
}
(( $+functions[_jade__users__help_commands] )) ||
_jade__users__help_commands() {
    local commands; commands=(
'new-user:' \
'root-password:' \
'help:Print this message or the help of the given subcommand(s)' \
    )
    _describe -t commands 'jade users help commands' commands "$@"
}
(( $+functions[_jade__users__help__help_commands] )) ||
_jade__users__help__help_commands() {
    local commands; commands=()
    _describe -t commands 'jade users help help commands' commands "$@"
}
(( $+functions[_jade__users__help__new-user_commands] )) ||
_jade__users__help__new-user_commands() {
    local commands; commands=()
    _describe -t commands 'jade users help new-user commands' commands "$@"
}
(( $+functions[_jade__users__help__root-password_commands] )) ||
_jade__users__help__root-password_commands() {
    local commands; commands=()
    _describe -t commands 'jade users help root-password commands' commands "$@"
}
(( $+functions[_jade__users__new-user_commands] )) ||
_jade__users__new-user_commands() {
    local commands; commands=()
    _describe -t commands 'jade users new-user commands' commands "$@"
}
(( $+functions[_jade__users__root-password_commands] )) ||
_jade__users__root-password_commands() {
    local commands; commands=()
    _describe -t commands 'jade users root-password commands' commands "$@"
}

if [ "$funcstack[1]" = "_jade" ]; then
    _jade "$@"
else
    compdef _jade jade
fi
