小编sid*_*yll的帖子

参数的消息在哪里显示?

我正在学习编写 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)

zsh autocomplete

6
推荐指数
2
解决办法
1289
查看次数

标签 统计

autocomplete ×1

zsh ×1