git - 如何使 zsh 完成显示所有参数?
问题描述
我的系统:macOS Catalina 10.15.6
zsh 版本:zsh 5.7.1 (x86_64-apple-darwin19.0)
git版本:2.26.2
zsh 完成代码
#compdef logs
args="`git branch -a | grep ${!#} | sed 's/\*//g' | sed 's/remotes\///g'`"
args="$args `git tag -l | grep "${!#}"`"
_arguments "*: :($args)"
当我logs
在 git 路径中使用时
> logs <tab>
zsh: do you wish to see all 150 possibilities (50 lines)?
当我在同一路径中使用git branch -a | wc -l
时git tag -l | wc -l
> git branch -a | wc -l
109
> git tag -l | wc -l
288
我有像release/v3.5.4-abc
和这样的分支名称release/v3.5.3-xxx
。
当我使用logs 3.5.4<tab>
.
release/v3.5.3-xxx
但是当我使用它时它会给我logs 3.5.3<tab>
。
似乎有些候选人被抛弃了。
我怎样才能获得所有候选人?
解决方案
推荐阅读
- wordpress - Codepen 集成到 Wordpress
- r - 如何通过仅选择原始列的偶数行来创建另一列?
- mysql - MySQL“手工”分区
- grails - Grails 3 PluginDescriptor 配置
- realm - 在 Payara 中使用具有不同基于文件的领域的 @RunAs
- html - HTML5 自定义元素和属性
- reactjs - 将图像作为道具传递
- ios - iOS 13.4 中的 MPMusicPlayerController.applicationQueuePlayer 错误
- assembly - 无法连续两次从变量中输出协处理器浮点数
- c++ - pop_back 中的垃圾值,C++ 中的双向链表