#!/bin/sh # # %W% %G% # Bruce Barnett 1986-1993 # # Usage: three cases # # helptool 2 exec # helptool exec(2) # helptool exec # # In all cases, a new window is created if a manual page exists. # ONCE="" SHOW="textedit -Wh 7" # Open WIndows #WHATIS=Key WHATIS="whatis" #SHOW="xedit" #X/11 #SHOW="TextEditor" # A/UX # set NAME to the name of the command without the section case $# in 2) # must be like case 1 ARG="$1 $2" ARGID="$2($1)" NAME="$2" ;; 1) # one argument - must be like case 3 above or case 2 # find out which one case "$1" in *\([0-9]*\)) # case 2 # change "cmd(1)" to "1 cmd" NAME=`echo $1|sed 's/\([a-zA-Z0-9_]*\)([1-8][A-Z]*)/\1/'` ARG=`echo $1|sed 's/\([a-zA-Z0-9_]*\)(\([1-8]\)[A-Z]*)/\2 \1/'` ARGID=$1; ;; [a-z09-9]*) # case 3 # fine the way it is, a simple command ARG=$1 NAME=$1 ;; esac ;; *) # error echo "need one argument"; exit 1 ;; esac # # move to the tmp directory so textedit will display # the file without a directory name cd /tmp #echo formatting "$ARG"... # format the manual page for dumb terminals # if textedit can handle bold (typeover) then this can eventually change # need an eval in case $ARG is 2 parameters eval man "$ARG" |ul -tdumb >/tmp/man$$ #error check - how many lines were generated count=`wc -l