aboutsummaryrefslogtreecommitdiffstats
path: root/scripts/w3mman/w3mman.in
diff options
context:
space:
mode:
authorTatsuya Kinoshita <tats@debian.org>2021-01-02 00:20:47 +0000
committerTatsuya Kinoshita <tats@debian.org>2021-01-02 00:20:47 +0000
commita722a562112506c63c9b6519b8252d633534a35a (patch)
tree78dc4b8bbefa910007339970eaf004f012d2082f /scripts/w3mman/w3mman.in
parentSwitch upstream to Debian's w3m (diff)
parentNew upstream version 0.5.3+git20210102 (diff)
downloadw3m-a722a562112506c63c9b6519b8252d633534a35a.tar.gz
w3m-a722a562112506c63c9b6519b8252d633534a35a.zip
Update upstream source from tag 'upstream/0.5.3+git20210102'
Update to upstream version '0.5.3+git20210102' with Debian dir e89c066385156d7c9ed01b0c8a1a08e01019959d
Diffstat (limited to '')
-rw-r--r--scripts/w3mman/w3mman.in22
1 files changed, 13 insertions, 9 deletions
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 <path>] [[<section>] <command>]\n";
- print STDERR "$_ [-M <path>] [-k <keyword>]\n";
+ print STDERR "$_ [-M <path>] [<section>] [-k <keyword>]\n";
print STDERR "$_ [-l <file>]\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 .= "&section=" . &form_encode($_);
} else {
- $query = "?quit=ok&man=" . &form_encode($_);
+ if ( $query eq "" ) { $query = "?quit=ok"; }
+ $query .= "&man=" . &form_encode($_);
}
}