很多次,我結束了圍繞書面方式包裝函數現有的,例如:巖組功能:前進完成到子功能
function gl {
some_computed_stuff=...
git --no-pager log --reverse $some_computed_stuff "[email protected]"
}
function m {
make "[email protected]" && notify-send success || notify-send failed
}
我知道,別名保持自動完成,但有時是必需的功能,在這種情況下自動完成丟失。 例如在這裏我想保留git log
完成我的功能gl
或make
完成m
。
我試着添加compctl -K _git gl
,但沒有提出任何建議。因爲我必須以某種方式找到如何提供log
參數_git
自動完成腳本一樣,所以我的問題是它無論如何都不會工作:
有沒有一種方法,使ZSH(也bash)的瞭解,鍵入gl
是確切的相當於git log
?喜歡的東西(只ZSH):
compctl 'git log' gl
compctl 'make' m