summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorKenny Woodson <kwoodson@redhat.com>2015-02-05 10:57:06 -0500
committerKenny Woodson <kwoodson@redhat.com>2015-02-05 10:57:06 -0500
commit912ba64e80dc3e086df4e9b65577fe490ff37c70 (patch)
tree11eac2fb433ce1c46b91c2fd42cff29cae9a398c
parentd124436d94a1e502f7f31a6958d01a513c8cb1a5 (diff)
downloadopenshift-912ba64e80dc3e086df4e9b65577fe490ff37c70.tar.gz
openshift-912ba64e80dc3e086df4e9b65577fe490ff37c70.tar.bz2
openshift-912ba64e80dc3e086df4e9b65577fe490ff37c70.tar.xz
openshift-912ba64e80dc3e086df4e9b65577fe490ff37c70.zip
Fixed zsh completion.
-rw-r--r--bin/_ossh_zsh_completion16
1 files changed, 10 insertions, 6 deletions
diff --git a/bin/_ossh_zsh_completion b/bin/_ossh_zsh_completion
index 05352bbbb..f057ca8ce 100644
--- a/bin/_ossh_zsh_completion
+++ b/bin/_ossh_zsh_completion
@@ -2,7 +2,7 @@
_ossh_known_hosts(){
if [[ -f ~/.ansible/tmp/multi_ec2_inventory.cache ]]; then
- /usr/bin/python -c 'import json,os; z = json.loads(open("%s"%os.path.expanduser("~/.ansible/tmp/multi_ec2_inventory.cache")).read()); print "\n".join(["%s.%s" % (host["ec2_tag_Name"],host["ec2_tag_environment"]) for dns, host in z["_meta"]["hostvars"].items()])'
+ print $(/usr/bin/python -c 'import json,os; z = json.loads(open("%s"%os.path.expanduser("~/.ansible/tmp/multi_ec2_inventory.cache")).read()); print "\n".join(["%s.%s" % (host["ec2_tag_Name"],host["ec2_tag_environment"]) for dns, host in z["_meta"]["hostvars"].items()])')
fi
}
@@ -10,11 +10,15 @@ _ossh(){
local curcontext="$curcontext" state line
typeset -A opt_args
- _arguments -s : \
- "*:Hosts:_ossh_known_hosts"
+#_arguments "*:Hosts:_ossh_known_hosts"
+ _arguments -s : \
+ "*:hosts:->hosts"
+
+ case "$state" in
+ hosts)
+ _values 'hosts' $(_ossh_known_hosts)
+ ;;
+ esac
- case $state in
- *)
-
}
_ossh "$@"