【问题标题】:Square brackets in zsh completion function argument description, possible?zsh完成函数参数描述中的方括号,可能吗?
【发布时间】:2012-09-21 00:48:05
【问题描述】:

基本上,我想知道是否可以这样做:

#compdef foo
_arguments \
    '--arg=[Description of --arg [With square brackets in the string!]]' \

由于嵌套的方括号而没有得到invalid option error

我尝试了各种转义字符。单引号和双引号没有区别。

【问题讨论】:

    标签: zsh zsh-completion


    【解决方案1】:

    尝试像这样逃避它们:

    '--arg=\\[Description of --arg \\[With square brackets in the string!\\]\\]'
    

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 1970-01-01
      • 2017-05-09
      • 1970-01-01
      • 2013-03-25
      • 2016-10-08
      • 2021-11-02
      • 2012-05-28
      • 1970-01-01
      相关资源
      最近更新 更多