#compdef dfrs

autoload -U is-at-least

_dfrs() {
    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[@]}" \
'--color=[Bypass tty detection for colors: auto, always, never]' \
'*-a[Show more, use twice to show all]' \
'--more[Show more]' \
'--all[Show all]' \
'-c[Bypass tty detection and always show colors]' \
'-i[Show inode instead of block usage]' \
'--inodes[Show inode instead of block usage]' \
'-h[Print sizes in powers of 1024 (e.g., 1023M)]' \
'--human-readable[Print sizes in powers of 1024 (e.g., 1023M)]' \
'-H[Print sizes in powers of 1000 (e.g., 1.1G)]' \
'--si[Print sizes in powers of 1000 (e.g., 1.1G)]' \
'-v[Verbose logging]' \
'--help[Prints help information]' \
'-V[Prints version information]' \
'--version[Prints version information]' \
'::paths:_files' \
":: :_dfrs_commands" \
"*::: :->dfrs" \
&& ret=0
    case $state in
    (dfrs)
        words=($line[2] "${words[@]}")
        (( CURRENT += 1 ))
        curcontext="${curcontext%:*:*}:dfrs-command-$line[2]:"
        case $line[2] in
            (completions)
_arguments "${_arguments_options[@]}" \
'-h[Prints help information]' \
'--help[Prints help information]' \
'-V[Prints version information]' \
'--version[Prints version information]' \
':shell:(zsh bash fish powershell elvish)' \
&& ret=0
;;
(help)
_arguments "${_arguments_options[@]}" \
'-h[Prints help information]' \
'--help[Prints help information]' \
'-V[Prints version information]' \
'--version[Prints version information]' \
&& ret=0
;;
        esac
    ;;
esac
}

(( $+functions[_dfrs_commands] )) ||
_dfrs_commands() {
    local commands; commands=(
        "completions:Generate shell completions" \
"help:Prints this message or the help of the given subcommand(s)" \
    )
    _describe -t commands 'dfrs commands' commands "$@"
}
(( $+functions[_dfrs__completions_commands] )) ||
_dfrs__completions_commands() {
    local commands; commands=(
        
    )
    _describe -t commands 'dfrs completions commands' commands "$@"
}
(( $+functions[_dfrs__help_commands] )) ||
_dfrs__help_commands() {
    local commands; commands=(
        
    )
    _describe -t commands 'dfrs help commands' commands "$@"
}

_dfrs "$@"