我正在学习编写 zsh 完成脚本,并在阅读文档时_arguments
发现了这一部分:
n:message:action
n::message:action
这描述了第 n 个正常参数。该消息将
打印在生成的匹配项上方,并且该操作指示 [...]
该消息在哪里打印?我正在尝试使用以下最小功能,但我无法弄清楚。我需要在我的 shell 中启用某些东西吗?
function _test {
_arguments '-a' '-b[description]:my message:(x y)'
}
Run Code Online (Sandbox Code Playgroud)
$ compdef _test program
Run Code Online (Sandbox Code Playgroud)
这导致:
$ program -b <tab>
x y
Run Code Online (Sandbox Code Playgroud)