认识
主页:https://github.com/scop/bash-completion
文档:https://github.com/scop/bash-completion/wiki
仓库:https://github.com/scop/bash-completion
bash-completion is a collection of command line command completions for the Bash shell, collection of helper functions to assist in creating new completions, and set of facilities for loading completions automatically on demand, as well as installing them. 简而言之,该程序为 GNU/Linux 常用命令(例如,ls、mv、ps、……)提供补全功能。
构建
安装方法:
- 或,参考源码目录下的 README.md 文件;
- 或,直接使用包管理器安装(各个 Linux 发行版已经包含该软件包,但是版本可能较旧)
应用
我们应该将第三方补全脚本安装到哪里?
根据官方文档,我们能够:
- 或,在 ~/.local/share/bash-completion/completions/ ,保存自定义脚本;
- 或,在 ~/.bash_completion 中,可以添加自定义脚本;
参考
Bash Completion Homepage
An easy bash completion tutorial?
GitHub/scop/bash-completion