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