# @generated by usage-cli from usage spec

# if "usage" is not installed show an error
if ! type -P usage &> /dev/null
    echo >&2
    echo "Error: usage CLI not found. This is required for completions to work in usage." >&2
    echo "See https://usage.jdx.dev for more information." >&2
    return 1
end
set -l spec_dir (if set -q XDG_CACHE_HOME; echo $XDG_CACHE_HOME; else; echo $HOME/.cache; end)/usage
test -d "$spec_dir"; or mkdir -p -m 700 "$spec_dir"
set -l spec_file "$spec_dir/usage__usage_spec_usage.spec"
command usage --usage-spec | string collect > "$spec_file"

set -l tokens
if commandline -x >/dev/null 2>&1
    complete -xc usage -a "(command usage complete-word --shell fish -f \"$spec_file\" -- (commandline -xpc) (commandline -t))"
else
    complete -xc usage -a "(command usage complete-word --shell fish -f \"$spec_file\" -- (commandline -opc) (commandline -t))"
end
