如果我键入以下内容,其中record是zsh函数
record ls
如何为record编写zsh完成,以便如果我编写
record ls -
它将使用zsh对ls的完成。
-1 -- single column output
-A -- list all except . and ..
-B -- print octal escapes for control characters
-C -- list entries in columns sorted vertically记录功能:
function record () {
local fp="`date +%F_%H-%M_%s`"
$@ 2>&1 | tee "${fp}.log"
}编辑time和/usr/bin/time似乎就是这样做的
如果我做了time ls -<tab>,它将给我ls的完成,我是如何为我自己的功能这么做的?
发布于 2014-01-27 12:51:44
您想要的是_precommand,这应该用于您的record命令。
compdef _precommand recordhttps://stackoverflow.com/questions/20411302
复制相似问题