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

front
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
}
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)
switch($i){
case /*
@ -18,14 +26,6 @@ for(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 not if(test -f /srv/sam.$user) dest = /srv/sam.$user
if not {

View File

@ -14,5 +14,5 @@ switch($#res){
case 0
echo $1: not found >[2=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
.PP
.B B
[
.BI -nnnn
]
.I file ...
.SH DESCRIPTION
.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.
.PP
.I B
is a shell-level command that causes an instance of
.I sam
running on the same terminal to load the named
.IR files .
.I B
uses either plumbing or the named pipe, whichever service is available.
If plumbing is not enabled,
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).
is a shell command that sends the named
.IR files
to the edit port of the plumber.
If plumbing is not available,
it attempts to load
.IR files
through the named pipe.
.SS Abnormal termination
If
.I sam