Keyboard shortcuts

Press or to navigate between chapters

Press S or / to search in the book

Press ? to show this help

Press Esc to hide this help

Generate

alias: g

生成 shell 补全脚本。

参数

  • -s, --shell <shell>: 目标 shell,默认 bash。支持 bash/zsh/fish 等(clap_complete::Shell)。环境变量 SHELL
  • -o, --output <output>: 输出文件路径;不指定时输出到 stdout。环境变量 OUTPUT

示例

# Bash
thurgio generate --shell bash > /etc/bash_completion.d/thurgio

# Zsh
thurgio generate --shell zsh > /usr/local/share/zsh/site-functions/_thurgio

# Fish
thurgio generate --shell fish > ~/.config/fish/completions/thurgio.fish

# 直接写入文件
thurgio generate -s fish -o ~/.config/fish/completions/thurgio.fish