Imported Upstream version 7.59.0
[platform/upstream/curl.git] / scripts / zsh.pl
index f0d8c19..1257190 100755 (executable)
@@ -1,4 +1,4 @@
-#!/usr/bin/perl
+#!/usr/bin/env perl
 
 # Generate ZSH completion
 
@@ -54,10 +54,11 @@ sub parse_main_opts {
         $option .= '}' if defined $short;
         $option .= '\'[' . trim($desc) . ']\'' if defined $desc;
 
-        $option .= ":$arg" if defined $arg;
+        $option .= ":'$arg'" if defined $arg;
 
         $option .= ':_files'
-            if defined $arg and ($arg eq 'FILE' || $arg eq 'DIR');
+            if defined $arg and ($arg eq '<file>' || $arg eq '<filename>'
+                || $arg eq '<dir>');
 
         push @list, $option;
     }