浏览代码

add task description to fabric completion

spacewander 8 年之前
父节点
当前提交
9dd76fb6bc
共有 1 个文件被更改,包括 4 次插入1 次删除
  1. 4 1
      plugins/fabric/_fab

+ 4 - 1
plugins/fabric/_fab

@@ -5,7 +5,10 @@ local curcontext=$curcontext state line
 declare -A opt_args
 
 declare target_list
-target_list=(`fab --shortlist 2>/dev/null`)
+IFS="$(printf '\n+')" target_list=($(fab -l | awk '{
+    if(NR > 2)
+        printf "%s:%s\n", $1, substr($0, index($0, $2))
+}' 2>/dev/null))
 
 _targets() {
     _describe -t commands "fabric targets" target_list