Loading scripts/zsh.pl +13 −2 Original line number Diff line number Diff line Loading @@ -38,7 +38,7 @@ sub parse_main_opts { my ($cmd, $regex) = @_; my @list; my @lines = split /\n/, `"$curl" $cmd`; my @lines = call_curl($cmd); foreach my $line (@lines) { my ($short, $long, $arg, $desc) = ($line =~ /^$regex/) or next; Loading Loading @@ -75,3 +75,14 @@ sub parse_main_opts { } sub trim { my $s = shift; $s =~ s/^\s+|\s+$//g; return $s }; sub call_curl { my ($cmd) = @_; my $output = `"$curl" $cmd`; if ($? == -1) { die "Could not run curl: $!"; } elsif ((my $exit_code = $? >> 8) != 0) { die "curl returned $exit_code with output:\n$output"; } return split /\n/, $output; } Loading
scripts/zsh.pl +13 −2 Original line number Diff line number Diff line Loading @@ -38,7 +38,7 @@ sub parse_main_opts { my ($cmd, $regex) = @_; my @list; my @lines = split /\n/, `"$curl" $cmd`; my @lines = call_curl($cmd); foreach my $line (@lines) { my ($short, $long, $arg, $desc) = ($line =~ /^$regex/) or next; Loading Loading @@ -75,3 +75,14 @@ sub parse_main_opts { } sub trim { my $s = shift; $s =~ s/^\s+|\s+$//g; return $s }; sub call_curl { my ($cmd) = @_; my $output = `"$curl" $cmd`; if ($? == -1) { die "Could not run curl: $!"; } elsif ((my $exit_code = $? >> 8) != 0) { die "curl returned $exit_code with output:\n$output"; } return split /\n/, $output; }