Skip to main content

Module completion

Module completion 

Source
Expand description

Shell completion infrastructure for autom8.

This module provides:

  • Shell detection from the $SHELL environment 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§

CompletionInstallResult
Result of completion installation.

Enums§

ShellType
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 $SHELL environment 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.