aboutsummaryrefslogtreecommitdiff
path: root/bin/B
diff options
context:
space:
mode:
authorrsc <devnull@localhost>2006-07-28 01:08:02 +0000
committerrsc <devnull@localhost>2006-07-28 01:08:02 +0000
commit0d5f0a724bc6ce5cb837afee442d7ecca470cf16 (patch)
treea658229c1c9068d05da07b2d529af6048ce21b3b /bin/B
parent9c15a456730e587aaa077be2b280a9c8a6c5172c (diff)
downloadplan9port-0d5f0a724bc6ce5cb837afee442d7ecca470cf16.tar.gz
plan9port-0d5f0a724bc6ce5cb837afee442d7ecca470cf16.tar.bz2
plan9port-0d5f0a724bc6ce5cb837afee442d7ecca470cf16.zip
allow +line syntax
Diffstat (limited to 'bin/B')
-rwxr-xr-xbin/B14
1 files changed, 13 insertions, 1 deletions
diff --git a/bin/B b/bin/B
index 1d8df247..d829374c 100755
--- a/bin/B
+++ b/bin/B
@@ -3,9 +3,19 @@
files=""
dest=""
+line=""
+if [ $# -gt 0 ]; then
+ case "$1" in
+ +[0-9]*)
+ line="`echo $1 | sed 's/+/:/'`"
+ shift
+ ;;
+ esac
+fi
+
if [ $# -eq 0 ]
then
- echo 'usage: B file...' 2>&1
+ echo 'usage: B [+line] file...' 2>&1
exit 1
fi
@@ -25,12 +35,14 @@ then
pwd="`pwd`"
for i
do
+ i="$i$line"
i=`cleanname -d "$pwd" "$i"`
plumb -s B -d edit "$i"
done
else
for i
do
+ i="$i$line"
pwd=`pwd`
file=`cleanname -d $pwd $i`
line=`echo $file | sed 's/.*://'`