From 9dd76fb6bc29071bd616d9ea32e29ce7b4dcba73 Mon Sep 17 00:00:00 2001 From: spacewander Date: Fri, 23 Sep 2016 12:02:23 +0800 Subject: [PATCH] add task description to fabric completion --- plugins/fabric/_fab | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/plugins/fabric/_fab b/plugins/fabric/_fab index 9628e122..79d596ed 100644 --- a/plugins/fabric/_fab +++ b/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