我有一个存在的unison配置文件列表~/.unison/*.prf.
我想要bash完成,以便当我键入unison或按unison-gtkTab键时,它将列出该.prf文件夹中没有该.prf部分的文件.
也许一个例子会更清楚:
$ ls ~/.unison/*.prf
default.prf dot-mozilla.prf to-desktop.prf
$ cd ~ # just to show you don't have to be in the ~/.unison folder
$ unison to<tab>
$ unison to-desktop
Run Code Online (Sandbox Code Playgroud)
我预见到另外一个工具也需要这个,所以如果有可以重复使用的部件会很方便.