Expand description
Shell completion infrastructure for autom8.
This module provides:
- Shell detection from the
$SHELLenvironment variable - Completion script generation for bash, zsh, and fish
- Installation path resolution for each shell type
§Usage
ⓘ
use autom8::completion::{detect_shell, get_completion_path, generate_completion_script};
// Detect user's shell
let shell = detect_shell()?;
// Get the installation path
let path = get_completion_path(shell)?;
// Generate the completion script
let script = generate_completion_script(shell);Structs§
- Completion
Install Result - Result of completion installation.
Enums§
- Shell
Type - Supported shell types for completion scripts.
Constants§
- SUPPORTED_
SHELLS - List of supported shell names for error messages.
Functions§
- detect_
shell - Detect the user’s shell from the
$SHELLenvironment variable. - ensure_
completion_ dir - Ensure the parent directory for a completion script exists.
- generate_
completion_ script - Generate a completion script for the specified shell.
- get_
completion_ path - Get the installation path for completion scripts.
- install_
completions - Install shell completions for the current user.
- parse_
shell_ from_ path - Parse a shell type from a shell path.
- print_
completion_ script - Output the completion script for a shell to stdout.
- write_
completion_ script - Write a completion script to the specified path.