B, Bfn: fix invocation with multiple files, improve manual page

This commit is contained in:
moody 2021-02-27 19:35:06 +01:00
parent 51f4f46ae0
commit f704965a45
3 changed files with 16 additions and 22 deletions

View file

@ -10,6 +10,14 @@ if(~ $#* 0){
exit usage exit usage
} }
if(test -f /mnt/plumb/edit || test -f /mnt/term/mnt/plumb/edit){
for(i)
plumb -s B -d edit $i
exit
}
# using sam srv file
for(i) for(i)
switch($i){ switch($i){
case /* case /*
@ -18,14 +26,6 @@ for(i)
files = ( $files `{cleanname `{pwd}^/$i} ) files = ( $files `{cleanname `{pwd}^/$i} )
} }
if(test -f /mnt/plumb/edit || test -f /mnt/term/mnt/plumb/edit){
plumb -s B -d edit $files
exit
}
# using sam srv file
if(test -f /mnt/term/srv/sam.$user) dest = /mnt/term/srv/sam.$user if(test -f /mnt/term/srv/sam.$user) dest = /mnt/term/srv/sam.$user
if not if(test -f /srv/sam.$user) dest = /srv/sam.$user if not if(test -f /srv/sam.$user) dest = /srv/sam.$user
if not { if not {

View file

@ -14,5 +14,5 @@ switch($#res){
case 0 case 0
echo $1: not found >[2=1] echo $1: not found >[2=1]
case 1 case 1
plumb $res B $res
} }

View file

@ -17,9 +17,6 @@ sam, B, sam.save, samterm \- screen editor with structural regular expressions
.B sam.save .B sam.save
.PP .PP
.B B .B B
[
.BI -nnnn
]
.I file ... .I file ...
.SH DESCRIPTION .SH DESCRIPTION
.I Sam .I Sam
@ -866,16 +863,13 @@ which acts as an additional source of commands. Characters written to
the named pipe are treated as if they had been typed in the command window. the named pipe are treated as if they had been typed in the command window.
.PP .PP
.I B .I B
is a shell-level command that causes an instance of is a shell command that sends the named
.I sam .IR files
running on the same terminal to load the named to the edit port of the plumber.
.IR files . If plumbing is not available,
.I B it attempts to load
uses either plumbing or the named pipe, whichever service is available. .IR files
If plumbing is not enabled, through the named pipe.
the option allows a line number to be specified for
the initial position to display in the last named file
(plumbing provides a more general mechanism for this ability).
.SS Abnormal termination .SS Abnormal termination
If If
.I sam .I sam