#compdef uu-sync

autoload -U is-at-least

_uu-sync() {
    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[@]}" : \
'(-d --data)-f[sync the file systems that contain the files (Linux and Windows only)]' \
'(-d --data)--file-system[sync the file systems that contain the files (Linux and Windows only)]' \
'(-f --file-system)-d[sync only file data, no unneeded metadata (Linux only)]' \
'(-f --file-system)--data[sync only file data, no unneeded metadata (Linux only)]' \
'-h[Print help]' \
'--help[Print help]' \
'-V[Print version]' \
'--version[Print version]' \
'::files:_files' \
&& ret=0
}

(( $+functions[_uu-sync_commands] )) ||
_uu-sync_commands() {
    local commands; commands=()
    _describe -t commands 'uu-sync commands' commands "$@"
}

if [ "$funcstack[1]" = "_uu-sync" ]; then
    _uu-sync "$@"
else
    compdef _uu-sync uu-sync
fi
