shithub: bin.rc

ref: 25f9e2963d99c77c9c6c259820474c89076e0921
dir: /bin/k/

View raw version
#!/bin/rc
# k - mark position (from sam)

marks=$ws/marks
if(~ $#marks 0)
	marks=/tmp/marks.default

while(~ $1 -* && ! ~ $1 --){
	switch($1){
	case -c
		>$marks; exit
	case -p
		plumb -d edit $marks
	case -v
		test -f $marks && window 'label marks; tail -f '$marks
		exit
	case *;
		exit usage
	}
	shift
}
if(~ $1 --)
	shift
	
if(~ $#% 0)
	exit notsam
echo $%:$'%l' $* >>$marks