mirror of
https://github.com/9fans/plan9port.git
synced 2025-01-12 11:10:07 +00:00
allow +line syntax
This commit is contained in:
parent
9c15a45673
commit
0d5f0a724b
1 changed files with 13 additions and 1 deletions
14
bin/B
14
bin/B
|
@ -3,9 +3,19 @@
|
||||||
files=""
|
files=""
|
||||||
dest=""
|
dest=""
|
||||||
|
|
||||||
|
line=""
|
||||||
|
if [ $# -gt 0 ]; then
|
||||||
|
case "$1" in
|
||||||
|
+[0-9]*)
|
||||||
|
line="`echo $1 | sed 's/+/:/'`"
|
||||||
|
shift
|
||||||
|
;;
|
||||||
|
esac
|
||||||
|
fi
|
||||||
|
|
||||||
if [ $# -eq 0 ]
|
if [ $# -eq 0 ]
|
||||||
then
|
then
|
||||||
echo 'usage: B file...' 2>&1
|
echo 'usage: B [+line] file...' 2>&1
|
||||||
exit 1
|
exit 1
|
||||||
fi
|
fi
|
||||||
|
|
||||||
|
@ -25,12 +35,14 @@ then
|
||||||
pwd="`pwd`"
|
pwd="`pwd`"
|
||||||
for i
|
for i
|
||||||
do
|
do
|
||||||
|
i="$i$line"
|
||||||
i=`cleanname -d "$pwd" "$i"`
|
i=`cleanname -d "$pwd" "$i"`
|
||||||
plumb -s B -d edit "$i"
|
plumb -s B -d edit "$i"
|
||||||
done
|
done
|
||||||
else
|
else
|
||||||
for i
|
for i
|
||||||
do
|
do
|
||||||
|
i="$i$line"
|
||||||
pwd=`pwd`
|
pwd=`pwd`
|
||||||
file=`cleanname -d $pwd $i`
|
file=`cleanname -d $pwd $i`
|
||||||
line=`echo $file | sed 's/.*://'`
|
line=`echo $file | sed 's/.*://'`
|
||||||
|
|
Loading…
Reference in a new issue