diff options
author | Nemo Inis <nemoinis@hotmail.com> | 2018-12-21 12:16:48 +0000 |
---|---|---|
committer | Tatsuya Kinoshita <tats@debian.org> | 2018-12-21 12:16:48 +0000 |
commit | 13c0ff556759662b67c20fc12b9d31f041024da2 (patch) | |
tree | 64fb4897ca5ed44f06b85f25ff099ffa9f486f5a /scripts/w3mman/w3mman.in | |
parent | Update ChangeLog (diff) | |
download | w3m-13c0ff556759662b67c20fc12b9d31f041024da2.tar.gz w3m-13c0ff556759662b67c20fc12b9d31f041024da2.zip |
w3mman support for section number during keyword search
Origin: https://bugs.debian.org/cgi-bin/bugreport.cgi?bug=916968#5
Diffstat (limited to 'scripts/w3mman/w3mman.in')
-rw-r--r-- | scripts/w3mman/w3mman.in | 13 |
1 files changed, 7 insertions, 6 deletions
diff --git a/scripts/w3mman/w3mman.in b/scripts/w3mman/w3mman.in index 6a27e70..2a33438 100644 --- a/scripts/w3mman/w3mman.in +++ b/scripts/w3mman/w3mman.in @@ -6,8 +6,8 @@ $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>] <command>]\n"; + print STDERR "$_ [-M <path>] [<section>] [-k <keyword>]\n"; print STDERR "$_ [-l <file>]\n"; exit 1; } @@ -20,7 +20,8 @@ while (@ARGV) { $ENV{'MANPATH'} = shift @ARGV; } elsif (/^-k$/) { @ARGV || &usage(); - $query = "?keyword=" . &form_encode(shift @ARGV); + if ( $query eq "" ) { $query = "?quit=ok"; } + $query .= "&keyword=" . &form_encode(shift @ARGV); } elsif (/^-l$/) { @ARGV || &usage(); $query = "?quit=ok&local=" . &form_encode(shift @ARGV); @@ -28,11 +29,11 @@ while (@ARGV) { } elsif (/^-/) { &usage(); } elsif (/^\d/ || $_ eq 'n') { - @ARGV || &usage(); - $query = "?quit=ok&man=" . &form_encode(shift @ARGV); + 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($_); } } |