[英]Bash autocompletion for pake WITH local files
I am using bash autocompletion for pake 我正在使用bash自动填充功能
_pake()
{
local cur=${COMP_WORDS[COMP_CWORD]}
COMPREPLY=( $(compgen -W "$(/www/grepo/vendor/bin/pake tasklist)" -- $cur) )
}
complete -F _pake pake
That works fine for all pake tasks, but how do I now add completion for my file system in addition to the task list? 这对于所有pake任务都可以正常工作,但是现在除了任务列表之外,如何为我的文件系统添加完成功能?
Got a reply to that question as a message. 得到了对该问题的答复作为消息。 The solution is quite easy, you can add a fallback behaviour to complete 解决方案非常简单,您可以添加后备行为来完成
complete -o default -F _pake pake
Given that, the auto complete behaviour falls bask to shell default if the custom completion does not deliver results 鉴于此,如果自定义完成未提供结果,则自动完成行为会掉入Shell默认值
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.