From 1d0ba25a660483da1272a31dd077ed94441e3d9f Mon Sep 17 00:00:00 2001 From: Tatsuya Kinoshita Date: Sat, 2 Jan 2021 09:20:37 +0900 Subject: New upstream version 0.5.3+git20210102 --- scripts/w3mman/w3mman.in | 22 +++++++++++++--------- 1 file changed, 13 insertions(+), 9 deletions(-) (limited to 'scripts/w3mman/w3mman.in') diff --git a/scripts/w3mman/w3mman.in b/scripts/w3mman/w3mman.in index 6a27e70..061cb1f 100644 --- a/scripts/w3mman/w3mman.in +++ b/scripts/w3mman/w3mman.in @@ -7,7 +7,7 @@ $SCRIPT = 'file:///$LIB/w3mman2html.cgi'; sub usage { ($_ = $0) =~ s@.*/@@; print STDERR "$_ [-M ] [[
] ]\n"; - print STDERR "$_ [-M ] [-k ]\n"; + print STDERR "$_ [-M ] [
] [-k ]\n"; print STDERR "$_ [-l ]\n"; exit 1; } @@ -20,19 +20,23 @@ while (@ARGV) { $ENV{'MANPATH'} = shift @ARGV; } elsif (/^-k$/) { @ARGV || &usage(); - $query = "?keyword=" . &form_encode(shift @ARGV); - } elsif (/^-l$/) { - @ARGV || &usage(); - $query = "?quit=ok&local=" . &form_encode(shift @ARGV); + if ( $query eq "" ) { $query = "?quit=ok"; } + $query .= "&keyword=" . &form_encode(shift @ARGV); + } elsif (/^-l$/ || /\//) { + if (/^-l$/) { + @ARGV || &usage(); + $_ = shift @ARGV; + } + $query = "?quit=ok&local=" . &form_encode($_); $query .= "&pwd=" . &form_encode($ENV{'PWD'}); } elsif (/^-/) { &usage(); - } elsif (/^\d/ || $_ eq 'n') { - @ARGV || &usage(); - $query = "?quit=ok&man=" . &form_encode(shift @ARGV); + } elsif (/^\d/ || $_ eq 'n' || $_ eq 'l') { + if ( $query eq "" ) { $query = "?quit=ok"; } $query .= "§ion=" . &form_encode($_); } else { - $query = "?quit=ok&man=" . &form_encode($_); + if ( $query eq "" ) { $query = "?quit=ok"; } + $query .= "&man=" . &form_encode($_); } } -- cgit v1.2.3