bash function preserving tab completion

无人久伴 提交于 2019-12-11 16:15:04

问题


I put the function

make_color() {
    make $1 | ccze -A
}

in .bashrc to get colorized make-output. His works fine, but makes tab-completion for selecting targets is lost. Is there any way to preserve the tab-completion of command in the function, or something else I could do to achieve tab completion and pipe?


回答1:


Add this in your ~/.bashrc or run in your local shell:

complete -F _make make_color 

The function name _make may be different in your case. You can get the name using:

$ complete -p make
complete -F _make make


来源:https://stackoverflow.com/questions/56448535/bash-function-preserving-tab-completion

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!