Complete recipe names in fish completion script (#625)
This commit is contained in:
parent
dc7210bca3
commit
fef69a3ec1
@ -1,3 +1,14 @@
|
|||||||
|
function __fish_just_complete_recipes
|
||||||
|
just --summary 2> /dev/null | tr " " "\n" || echo ""
|
||||||
|
end
|
||||||
|
|
||||||
|
# don't suggest files right off
|
||||||
|
complete -c just -n "__fish_is_first_arg" --no-files
|
||||||
|
|
||||||
|
# complete recipes
|
||||||
|
complete -c just -a '(__fish_just_complete_recipes)'
|
||||||
|
|
||||||
|
# autogenerated completions
|
||||||
complete -c just -n "__fish_use_subcommand" -l color -d 'Print colorful output' -r -f -a "auto always never"
|
complete -c just -n "__fish_use_subcommand" -l color -d 'Print colorful output' -r -f -a "auto always never"
|
||||||
complete -c just -n "__fish_use_subcommand" -s f -l justfile -d 'Use <JUSTFILE> as justfile.'
|
complete -c just -n "__fish_use_subcommand" -s f -l justfile -d 'Use <JUSTFILE> as justfile.'
|
||||||
complete -c just -n "__fish_use_subcommand" -l set -d 'Override <VARIABLE> with <VALUE>'
|
complete -c just -n "__fish_use_subcommand" -l set -d 'Override <VARIABLE> with <VALUE>'
|
||||||
|
@ -23,6 +23,19 @@ pub(crate) enum Subcommand {
|
|||||||
Variables,
|
Variables,
|
||||||
}
|
}
|
||||||
|
|
||||||
|
const FISH_RECIPE_COMPLETIONS: &str = r#"function __fish_just_complete_recipes
|
||||||
|
just --summary 2> /dev/null | tr " " "\n" || echo ""
|
||||||
|
end
|
||||||
|
|
||||||
|
# don't suggest files right off
|
||||||
|
complete -c just -n "__fish_is_first_arg" --no-files
|
||||||
|
|
||||||
|
# complete recipes
|
||||||
|
complete -c just -a '(__fish_just_complete_recipes)'
|
||||||
|
|
||||||
|
# autogenerated completions
|
||||||
|
"#;
|
||||||
|
|
||||||
const ZSH_COMPLETION_REPLACEMENTS: &[(&str, &str)] = &[
|
const ZSH_COMPLETION_REPLACEMENTS: &[(&str, &str)] = &[
|
||||||
(
|
(
|
||||||
r#" _arguments "${_arguments_options[@]}" \"#,
|
r#" _arguments "${_arguments_options[@]}" \"#,
|
||||||
@ -127,6 +140,10 @@ impl Subcommand {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if let clap::Shell::Fish = shell {
|
||||||
|
script.insert_str(0, FISH_RECIPE_COMPLETIONS);
|
||||||
|
}
|
||||||
|
|
||||||
println!("{}", script.trim());
|
println!("{}", script.trim());
|
||||||
|
|
||||||
Ok(())
|
Ok(())
|
||||||
|
Loading…
Reference in New Issue
Block a user