Zsh Mailing List Archive
Messages sorted by: Reverse Date, Date, Thread, Author

Re: [PATCH] Remove curl completion



Vincent Lefevre wrote on Thu, Nov 19, 2015 at 12:41:06 +0100:
> On 2015-11-18 16:20:52 -0800, Bart Schaefer wrote:
> > On Nov 18, 11:16pm, Daniel Shahaf wrote:
> > } Upstream now ships a completion that is a superset of this one.
> > 
> > I wish there were some way to conditionalize this.  I dislike the
> > assumption that bleeding-edge curl and bleeding-edge zsh will always
> > be installed together.  If I upgrade zsh but not curl, suddenly my
> > curl completion disappears entirely.
> 
> Shouldn't the part concerning curl in
> $prefix/share/zsh/functions/Completion/Unix/_urls
> be moved to its own .../Completion/Unix/_curl, and curl install
> its completion in $prefix/share/zsh/vendor-completions so that
> it has the precedence?

+1.  Will this suffice to implement Vincent's idea?

diff --git a/Completion/Unix/Command/_curl b/Completion/Unix/Command/_curl
new file mode 100644
index 0000000..72e2e5b
--- /dev/null
+++ b/Completion/Unix/Command/_curl
@@ -0,0 +1,7 @@
+#compdef curl
+
+# As of 7.43.0, curl upstream provides its own _curl definition.  This
+# definition is provided as a fallback, and should be installed later
+# in $fpath than the curl-provided definition of _curl.
+
+_urls "$@"
diff --git a/Completion/Unix/Type/_urls b/Completion/Unix/Type/_urls
index 6f23803..e81eaac 100644
--- a/Completion/Unix/Type/_urls
+++ b/Completion/Unix/Type/_urls
@@ -1,4 +1,4 @@
-#compdef curl -value-,WWW_HOME,-default- -P -value-,(ftp|http(|s))_proxy,-default-
+#compdef -value-,WWW_HOME,-default- -P -value-,(ftp|http(|s))_proxy,-default-
 
 # Configuration styles used:
 #



Messages sorted by: Reverse Date, Date, Thread, Author