summaryrefslogtreecommitdiff
path: root/dis/lookman
diff options
context:
space:
mode:
Diffstat (limited to 'dis/lookman')
-rw-r--r--dis/lookman18
1 files changed, 18 insertions, 0 deletions
diff --git a/dis/lookman b/dis/lookman
new file mode 100644
index 00000000..edf8972b
--- /dev/null
+++ b/dis/lookman
@@ -0,0 +1,18 @@
+#!/dis/sh
+load std
+
+fn cmdform {
+ sed 's;/man/;;
+ s;(.*)/(.*);man \1 \2 # \2(\1);'
+}
+post=cmdform
+
+x=$*
+~ $1 -f && {
+ post=cat
+ x=${tl $x}
+}
+x=`{echo $x|tr A-Z a-z|tr -dc 'a-z0-9_ \012'} # fold case, delete funny chars
+~ $#x 0 && {echo Usage: lookman key ... >[1=2]; exit usage}
+
+look $x /man/index | sed 's/^.* //' |sort |uniq | $post