Plan 9 from Bell Labs’s /usr/web/sources/contrib/uriel/changes/2006/0129/3

Copyright © 2021 Plan 9 Foundation.
Distributed under the MIT License.
Download the Plan 9 distribution.


Add -w, -b, and -S flags to man.  Make it case-insensitive.
 [rsc] --rwxrwxr-x M 1487869 glenda sys 2520 Jan 29 12:21 rc/bin/man
	/n/sourcesdump/2006/0129/plan9/rc/bin/man:48,56 - 
	/n/sourcesdump/2006/0130/plan9/rc/bin/man:48,57
	  }
	  
	  
	+ search=yes
	  while(~ $d 0) {
	  	if(~ $#* 0) {
	- 		echo 'Usage: man [-ntp] [-s sec] [0-9] [0-9] ... name1 name2 ...' >[1=2]
	+ 		echo 'Usage: man [-bntpPSw] [0-9] [0-9] ... name1 name2 ...' >[1=2]
	  		exit
	  	}
	  	if(test -d $S/$1){
	/n/sourcesdump/2006/0129/plan9/rc/bin/man:62,67 - 
	/n/sourcesdump/2006/0130/plan9/rc/bin/man:63,71
	  		case -n ; cmd=n ; shift
	  		case -p ; cmd=p ; shift
	  		case -P ; cmd=P ; shift
	+ 		case -w ; cmd=w ; shift
	+ 		case -b ; cmd=b ; shift
	+ 		case -S ; search=no ; shift
	  		case * ; d=1
	  	}
	  }
	/n/sourcesdump/2006/0129/plan9/rc/bin/man:72,80 - 
	/n/sourcesdump/2006/0130/plan9/rc/bin/man:76,85
	  if(~ $#* 1) pat='^'^$1^' '
	  if not pat='^('^`{echo $* | sed 's/ /|/g'}^') '
	  fils=()
	+ if(~ $search yes)
	  for(i in $S/$sec){
	  	if(/bin/test -f $i/INDEX){
	- 		try=`{grep $pat $i/INDEX | sed 's/^[^ ]* //'}
	+ 		try=`{grep -i $pat $i/INDEX | sed 's/^[^ ]* //'}
	  		if(! ~ $#try 0)
	  			fils=($fils $i/$try)
	  	}
	/n/sourcesdump/2006/0129/plan9/rc/bin/man:83,90 - 
	/n/sourcesdump/2006/0130/plan9/rc/bin/man:88,96
	  if(~ $#fils 0) {
	  	# nothing in INDEX. try for file of given name
	  	for(i) {
	+ 		if(~ $i intro) i=0intro
	  		for(n in $sec) {
	- 			try=$S/$n/$i
	+ 			try=`{echo $S/$n/$i | tr A-Z a-z}
	  			if (/bin/test -f $try)
	  				fils=($fils $try)
	  		}
	/n/sourcesdump/2006/0129/plan9/rc/bin/man:99,104 - 
	/n/sourcesdump/2006/0130/plan9/rc/bin/man:105,113
	  		echo need $i >[1=2]
	  	if not {
	  		switch($cmd) {
	+ 		case w
	+ 			echo $i
	+ 
	  		case t
	  			roff t $i
	  
	/n/sourcesdump/2006/0129/plan9/rc/bin/man:115,120 - 
	/n/sourcesdump/2006/0130/plan9/rc/bin/man:124,140
	  				}
	  				//N
	  				/^\n$/D'
	+ 
	+ 		case b
	+ 			x=`{echo $i | sed 's;/sys/man/(.*)/(.*);\1 \2;'}
	+ 			if(~ $x(2) 0intro) x=($x(1) intro)
	+ 			roff n $i | sed '
	+ 				${
	+         			       /^$/p
	+ 				}
	+ 				//N
	+ 				/^\n$/D' |
	+ 			plumb -i -d edit -a 'action=showdata filename=/man/'$x(2)^'('$x(1)^')'
	  		}
	  	}
	  }
 [rsc] --rw-rw-r-- M 1487869 glenda sys 2006 Jan 29 12:18 sys/man/1/man
	/n/sourcesdump/2006/0129/plan9/sys/man/1/man:4,10 - 
	/n/sourcesdump/2006/0130/plan9/sys/man/1/man:4,10
	  .SH SYNOPSIS
	  .B man
	  [
	- .B -ntpP
	+ .B -bnpPStw
	  ]
	  [
	  .I section ...
	/n/sourcesdump/2006/0129/plan9/sys/man/1/man:45,50 - 
	/n/sourcesdump/2006/0130/plan9/sys/man/1/man:45,57
	  Print the pages on the standard output using
	  .IR nroff .
	  .TP
	+ .B -b
	+ Print the pages using
	+ .I nroff
	+ and send them to 
	+ .IR plumber (1)
	+ for display in the editor.
	+ .TP
	  .B -p
	  Run
	  .IR proof (1)
	/n/sourcesdump/2006/0129/plan9/sys/man/1/man:55,65 - 
	/n/sourcesdump/2006/0130/plan9/sys/man/1/man:62,79
	  .IR page (1)
	  on the specified man pages.
	  .TP
	+ .B -S
	+ Do not search the manual indices for the names.
	+ Only print pages whose file names match the names.
	+ .TP
	  .B -t
	  Run
	  .IR troff (1)
	  and send its output
	  to standard output.
	+ .TP
	+ .B -w
	+ Print the names of the man page source files.
	  .PD
	  .PP
	  .B Lookman


Bell Labs OSI certified Powered by Plan 9

(Return to Plan 9 Home Page)

Copyright © 2021 Plan 9 Foundation. All Rights Reserved.
Comments to webmaster@9p.io.