---
source: lib/src/complete/nu.rs
expression: "complete_nu(&CompleteOptions\n{\n    usage_bin: \"usage\".to_string(), shell: \"nu\".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
module _mycli_completions {
    def mycli_completer [spans: list<string>] {
        let spec_file = $"($nu.temp-dir)/usage__usage_spec_mycli_1_2_3.spec"
        if not ($spec_file | path exists) {
            ^mycli complete --usage | collect | save $spec_file
        }

        (^usage complete-word -f $spec_file --shell nu -- ...$spans)
        | lines
        | each {|it| $it | split column "\t" | rename value description | into record }
    }

    @complete mycli_completer
    export extern mycli []
}


# if "usage" is not installed show an error
if (which usage | is-empty) {
    return (error make {
        msg: "Error: usage CLI not found. This is required for completions to work in mycli.",
        help: "See https://usage.jdx.dev for more information."
    })
}
use _mycli_completions *
