#compdef miniserve

autoload -U is-at-least

_miniserve() {
    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[@]}" \
'--index=[The name of a directory index file to serve, like "index.html"]' \
'-p+[Port to use]' \
'--port=[Port to use]' \
'*-i+[Interface to listen on]' \
'*--interfaces=[Interface to listen on]' \
'*-a+[Set authentication. Currently supported formats: username:password, username:sha256:hash, username:sha512:hash (e.g. joe:123, joe:sha256:a665a45920422f9d417e4867efdc4fb8a04a1f3fff1fa07e998e86f7f7a27ae3)]' \
'*--auth=[Set authentication. Currently supported formats: username:password, username:sha256:hash, username:sha512:hash (e.g. joe:123, joe:sha256:a665a45920422f9d417e4867efdc4fb8a04a1f3fff1fa07e998e86f7f7a27ae3)]' \
'-c+[Default color scheme]: :(squirrel archlinux zenburn monokai)' \
'--color-scheme=[Default color scheme]: :(squirrel archlinux zenburn monokai)' \
'-d+[Default color scheme]: :(squirrel archlinux zenburn monokai)' \
'--color-scheme-dark=[Default color scheme]: :(squirrel archlinux zenburn monokai)' \
'-t+[Shown instead of host in page title and heading]' \
'--title=[Shown instead of host in page title and heading]' \
'*--header=[Set custom header for responses]' \
'--print-completions=[Generate completion file for a shell]: :(zsh bash fish powershell elvish)' \
'-v[Be verbose, includes emitting access logs]' \
'--verbose[Be verbose, includes emitting access logs]' \
'--random-route[Generate a random 6-hexdigit route]' \
'-P[Do not follow symbolic links]' \
'--no-symlinks[Do not follow symbolic links]' \
'-H[Show hidden files]' \
'--hidden[Show hidden files]' \
'-q[Enable QR code display]' \
'--qrcode[Enable QR code display]' \
'-u[Enable file uploading]' \
'--upload-files[Enable file uploading]' \
'-o[Enable overriding existing files during file upload]' \
'--overwrite-files[Enable overriding existing files during file upload]' \
'-r[Enable tar archive generation]' \
'--enable-tar[Enable tar archive generation]' \
'-z[Enable zip archive generation]' \
'--enable-zip[Enable zip archive generation]' \
'-D[List directories first]' \
'--dirs-first[List directories first]' \
'-F[Hide version footer]' \
'--hide-version-footer[Hide version footer]' \
'-h[Prints help information]' \
'--help[Prints help information]' \
'-V[Prints version information]' \
'--version[Prints version information]' \
'::PATH -- Which path to serve:_files' \
&& ret=0
    
}

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

_miniserve "$@"