Skip to main content

FISH

Constant FISH 

Source
pub const FISH: &str = r#"# majordomus — shell completion, generated by `majordomus completion init --shell fish`.
# Carries no command, no flag and no identifier: every candidate comes from
# `majordomus completion query`.
function __majordomus_complete
    set -l bin majordomus
    if set -q MAJORDOMUS_COMPLETION_BIN
        set bin $MAJORDOMUS_COMPLETION_BIN
    end
    set -l words (commandline -opc)
    set -l current (commandline -ct)
    set -l surface cli
    if test (count $words) -gt 0; and test $words[1] = just
        set surface workflow
    end
    command $bin completion query --surface $surface --format text --cursor (count $words) -- $words $current 2>/dev/null
end
complete -c majordomus -f -a '(__majordomus_complete)'
complete -c majordomus-cli -f -a '(__majordomus_complete)'
complete -c just -f -a '(__majordomus_complete)'
"#;
Expand description

The fish integration.

fish’s own completion protocol is a value, a tab, a description — which is the text protocol this engine already prints, so the adapter forwards the answer unaltered rather than reformatting it.