Finish Tips

This commit is contained in:
fishBone000 2024-09-18 04:12:15 +00:00
parent 6c8cd1b111
commit f5e58a5ca7
No known key found for this signature in database
GPG Key ID: 8B184E316F948E2A
1 changed files with 4 additions and 5 deletions

View File

@ -432,11 +432,10 @@ _arguments、_alternative、_regex_arguments等的定义处要在正确的地方
使用_regex_arguments时要记得在开头写匹配命令的模式不需要加入匹配动作action
记得在_regex_arguments的任何PATTERN模式参数后加上null字符$'\0'
* Tips
Sometimes you have a situation where there is just one option that can come after a subcommand, and zsh will complete this
automatically when tab is pressed after the subcommand. If instead you want it listed with its description before completing
you can add another empty option (i.e. \:) to the ACTION like this ':TAG:DESCRIPTION:((opt1\:"description for opt1" \:))'
Note this only applies to utility functions that use ACTIONs in their specification arguments (_arguments, _regex_arguments, etc.)
* 小贴士
有时一个子命令后只会跟一个选项这时zsh会在tab在子命令后按下时自动补全。如果你想要在补全前先列出选项和描述
你可以向ACTION动作加入另一个空选项比如\:),如':TAG:DESCRIPTION:((opt1\:"opt1描述" \:))'
注意这只对在定义参数中使用ACTION的工具函数_arguments、_regex_arguments等有效。
* Other resources
[[https://wikimatze.de/writing-zsh-completion-for-padrino/][Here]] is a nicely formatted short tutorial showing basic usage of the _arguments function,