---
source: lib/src/complete/fish.rs
expression: "complete_fish(&CompleteOptions\n{\n    usage_bin: \"usage\".to_string(), shell: \"fish\".to_string(), bin:\n    \"mycli\".to_string(), cache_key: Some(\"1.2.3\".to_string()), spec: None,\n    usage_cmd: Some(\"mycli complete --usage\".to_string()),\n    include_bash_completion_lib: false, source_file: None,\n})"
---
# @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 mycli." >&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_mycli_1_2_3.spec"
if not test -f "$spec_file"
    find "$spec_dir" -maxdepth 1 -name 'usage__usage_spec_mycli_*.spec' -type f -mtime +30 -delete 2>/dev/null
    mycli complete --usage | string collect > "$spec_file"
end

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