about summary refs log tree commit diff stats
path: root/adapter
diff options
context:
space:
mode:
authorbptato <nincsnevem662@gmail.com>2024-03-09 15:23:54 +0100
committerbptato <nincsnevem662@gmail.com>2024-03-11 17:05:27 +0100
commit5572c468582f9f4796b274e98c738dee51c30e90 (patch)
tree83f84b846dae4a93946acda7afd271736a87e5c4 /adapter
parent9b69d02409737768caeb3b305f0217c138fd1ec2 (diff)
downloadchawan-5572c468582f9f4796b274e98c738dee51c30e90.tar.gz
mancha: fix query for 7z
Diffstat (limited to 'adapter')
-rw-r--r--adapter/tools/mancha.nim8
1 files changed, 7 insertions, 1 deletions
diff --git a/adapter/tools/mancha.nim b/adapter/tools/mancha.nim
index 2e09b51f..2c4c7c34 100644
--- a/adapter/tools/mancha.nim
+++ b/adapter/tools/mancha.nim
@@ -29,6 +29,7 @@ proc main() =
   var local = ""
   var man = ""
   var keyword = ""
+  var forceSection = false
   while i <= n:
     let s = paramStr(i)
     if s == "":
@@ -42,7 +43,9 @@ proc main() =
       case s[1]
       of 'h': help(0)
       of 'M': putEnv("MANPATH", getnext())
-      of 's': section = getnext()
+      of 's':
+        section = getnext()
+        forceSection = true
       of 'l': local = getnext()
       of 'k': keyword = getnext()
       else: help(1)
@@ -53,6 +56,9 @@ proc main() =
     else:
       help(1)
     inc i
+  if not forceSection and section != "" and man == "":
+    man = section
+    section = ""
   if not ((local != "") != (man != "") != (keyword != "")):
     help(1)
   if local != "" and section != "":