Skip to main content

print_bash_script

Function print_bash_script 

Source
pub fn print_bash_script(app_name: &str)
Expand description

Generate a bash completion script that calls back into the app.

The emitted script is intentionally minimal — a single complete -F registration plus a body that hands the raw $COMP_LINE and $COMP_POINT to the binary. All word-splitting and candidate logic runs in Rust inside handle_complete_env; the bash side never sees the completion rules. That keeps user-facing behavior from drifting between shell and binary on upgrades — the only thing that can break is the (trivial) handoff itself.