diff --git a/scripts/completion.pl b/scripts/completion.pl index 8bbf4838ab..299f86055c 100755 --- a/scripts/completion.pl +++ b/scripts/completion.pl @@ -102,11 +102,20 @@ sub parse_main_opts { $option .= '}' if defined $short; $option .= '\'[' . trim($desc) . ']\'' if defined $desc; - $option .= ":'$arg'" if defined $arg; - - $option .= ':_files' - if defined $arg and ($arg eq '' || $arg eq '' - || $arg eq ''); + if (defined $arg) { + $option .= ":'$arg'"; + if ($arg =~ /|/) { + $option .= ':_files'; + } elsif ($arg =~ //) { + $option .= ":'_path_files -/'"; + } elsif ($arg =~ //i) { + $option .= ':_urls'; + } elsif ($long =~ /ftp/ && $arg =~ //) { + $option .= ":'(multicwd nocwd singlecwd)'"; + } elsif ($arg =~ //) { + $option .= ":'(DELETE GET HEAD POST PUT)'"; + } + } } push @list, $option;