我有一个 bash-completion 脚本,安装如下(在带有 MacPort 版本 bash-completion 的 macOS 上)
$ pkg-config --variable=completionsdir bash-completion
/opt/local/share/bash-completion/completions
$ sudo cp check_ssl_cert.completion /opt/local/share/bash-completion/completions/check_ssl_cert
该脚本不会自动加载(与目录中的所有其他脚本一样)。
但如果手动采购似乎可以工作
$ complete -p check_ssl_cert
-bash: complete: check_ssl_cert: no completion specification
$ source /opt/local/share/bash-completion/completions/check_ssl_cert
$ complete -p check_ssl_cert
complete -F _check_ssl_cert check_ssl_cert
权限和所有权与所有其他完成脚本相同。
例如:
$ ls -l /opt/local/share/bash-completion/completions/check*
-rw-r--r-- 1 root admin 374 Nov 3 03:22 /opt/local/share/bash-completion/completions/check_db
-rw-r--r-- 1 root admin 319 Nov 3 03:22 /opt/local/share/bash-completion/completions/check_perms
-rw-r--r-- 1 root admin 2708 Feb 17 21:29 /opt/local/share/bash-completion/completions/check_ssl_cert
-rw-r--r-- 1 root admin 746 Nov 3 03:22 /opt/local/share/bash-completion/completions/checksec
关于我做错了什么的任何提示吗?