From: Eric Cook <llua@gmx.com>
To: zsh-workers@zsh.org
Subject: Re: Completion of swift fails when swift(1) is from Apple, not OpenStack
Date: Sat, 28 Jan 2017 14:54:46 -0500 [thread overview]
Message-ID: <467fa14f-b097-f21d-ef84-0b1459b835a6@gmx.com> (raw)
In-Reply-To: <alpine.LRH.2.00.1701281005590.4560@toltec.zanshin.com>
[-- Attachment #1: Type: text/plain, Size: 151 bytes --]
Here is a swing at giving filename completion, i don't have access to os x
or openstack to really test it or add actual completion for apple's swift.
[-- Attachment #2: 0001-create-stub-swift-function.patch --]
[-- Type: text/x-patch, Size: 1593 bytes --]
>From 59a1296b6e154974324cc6109cec4943f66fbeec Mon Sep 17 00:00:00 2001
From: Eric Cook <llua@gmx.com>
Date: Sat, 28 Jan 2017 14:49:53 -0500
Subject: [PATCH] create stub swift function
---
Completion/Unix/Command/_openstack | 2 +-
Completion/Unix/Command/_swift | 13 +++++++++++++
2 files changed, 14 insertions(+), 1 deletion(-)
create mode 100644 Completion/Unix/Command/_swift
diff --git a/Completion/Unix/Command/_openstack b/Completion/Unix/Command/_openstack
index 39fa30c..69e4921 100644
--- a/Completion/Unix/Command/_openstack
+++ b/Completion/Unix/Command/_openstack
@@ -1,4 +1,4 @@
-#compdef openstack aodh barbican ceilometer cinder cloudkitty designate glance gnocchi heat ironic keystone magnum manila mistral monasca murano neutron nova sahara senlin swift trove
+#compdef openstack aodh barbican ceilometer cinder cloudkitty designate glance gnocchi heat ironic keystone magnum manila mistral monasca murano neutron nova sahara senlin trove
# https://wiki.openstack.org/wiki/OpenStackClients
# http://docs.openstack.org/user-guide/common/cli-install-openstack-command-line-clients.html
diff --git a/Completion/Unix/Command/_swift b/Completion/Unix/Command/_swift
new file mode 100644
index 0000000..b29cc35
--- /dev/null
+++ b/Completion/Unix/Command/_swift
@@ -0,0 +1,13 @@
+#compdef swift
+
+local variant ret=1
+if _pick_variant -r variant apple='OVERVIEW: Swift compiler' openstack --help; then
+ case $variant in
+ apple)
+ _call_function ret _default;;
+ openstack)
+ _call_function ret _openstack;;
+ esac
+
+ return ret
+fi
--
2.9.2
next prev parent reply other threads:[~2017-01-28 19:55 UTC|newest]
Thread overview: 6+ messages / expand[flat|nested] mbox.gz Atom feed top
2017-01-28 17:34 Zhiming Wang
2017-01-28 17:42 ` Zhiming Wang
2017-01-28 18:08 ` Bart Schaefer
2017-01-28 19:54 ` Eric Cook [this message]
2017-01-28 20:40 ` Zhiming Wang
2017-01-28 20:52 ` Zhiming Wang
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=467fa14f-b097-f21d-ef84-0b1459b835a6@gmx.com \
--to=llua@gmx.com \
--cc=zsh-workers@zsh.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
Code repositories for project(s) associated with this public inbox
https://git.vuxu.org/mirror/zsh/
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).