bash function preserving tab completion

2019-08-26 08:49发布

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条回答
再贱就再见
2楼-- · 2019-08-26 09:32

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
查看更多
登录 后发表回答