_arguments(zsh完成)にタグ記述を設定する方法

_arguments(zsh完成)にタグ記述を設定する方法

を使用すると、zstyle ':completion:*:descriptions' format '%d'完成オプションの上に短いタイトルが表示されます。

短い例は次のとおりです。

prompt% function _myfun1() { _arguments '--debug[print some debug]' '--quiet[do not print stuff]'}
prompt% compdef _myfun1 myfun1
prompt% myfun1⇥
option:
--debug  -- print some debug
--quiet  -- do not print stuff

この説明は使用時に_describe指定できます_describe -t tagname "description" arraywithoptions。別の説明でデフォルト値を上書きできますか_argumentoption

ベストアンサー1

optionsで追加したタグだけでなく、タグであるすべての項目でそれを上書きできます_arguments

zstyle ':completion:*:options:descriptions' format '%Boverriden option%b'

おすすめ記事