Skip to main content

get_completion_path

Function get_completion_path 

Source
pub fn get_completion_path(shell: ShellType) -> Result<PathBuf>
Expand description

Get the installation path for completion scripts.

Returns the appropriate path for each shell:

  • Bash: ~/.local/share/bash-completion/completions/autom8 (XDG standard) Falls back to ~/.bash_completion.d/autom8 if XDG path doesn’t exist
  • Zsh: ~/.zfunc/_autom8
  • Fish: ~/.config/fish/completions/autom8.fish

§Arguments

  • shell - The target shell type

§Returns

  • Ok(PathBuf) - The path where the completion script should be installed
  • Err(Autom8Error) - If the home directory cannot be determined