~strahinja/ste

a812a36d474b852ffdf6d171f293d1f62ac204e6 — Страхиња Радић 8 months ago a3efcfd v0.5
Handle symlinks correctly, like sled (operate on destination)

Signed-off-by: Страхиња Радић <contact@strahinja.org>
7 files changed, 17 insertions(+), 4 deletions(-)

M TODO
M TODO.done
A test/symlink.tsv
M tsvdel
M tsvedit
M tsvins
M tsvmove
M TODO => TODO +0 -4
@@ 1,10 1,6 @@
TODO
====

[ ] Check handling of symlinks (should be the same as sled)

<x> Transform tsv* to work as stdin/stdout filters

< > Command to insert/delete a column?

< > Command to replace a cell with [string]?

M TODO.done => TODO.done +4 -0
@@ 1,6 1,10 @@
Done todos
==========

[x] Check handling of symlinks (should be the same as sled)

<x> Transform tsv* to work as stdin/stdout filters

[x] Bugfix: (table?) rows having full number of cols, then some with less than
    that, then again with full number, don't get drawn correctly
    	- Probably due to table paging

A test/symlink.tsv => test/symlink.tsv +1 -0
@@ 0,0 1,1 @@
test.tsv
\ No newline at end of file

M tsvdel => tsvdel +3 -0
@@ 32,6 32,9 @@ case $# in
		;;
esac

if [ -L $inputfile ]; then
	inputfile=$(readlink -f $inputfile)
fi
tmpf=${inputfile}~

[ -w "${inputfile}" ] || { error "\`${inputfile}' not writeable"; exit 1; }

M tsvedit => tsvedit +3 -0
@@ 34,6 34,9 @@ case $# in
		;;
esac

if [ -L $inputfile ]; then
	inputfile=$(readlink -f $inputfile)
fi
tmpf=${inputfile}~
[ -w "${inputfile}" ] || { error "\`${inputfile}' not writeable"; exit 1; }
numlines=$(awk 'END {print NR}' "${inputfile}")

M tsvins => tsvins +3 -0
@@ 35,6 35,9 @@ esac

[ ! -f "${inputfile}" ] && touch -- "${inputfile}"

if [ -L $inputfile ]; then
	inputfile=$(readlink -f $inputfile)
fi
tmpf=${inputfile}~
numlines=$(awk 'END {print NR}' "${inputfile}")
# shellcheck disable=SC2086

M tsvmove => tsvmove +3 -0
@@ 34,6 34,9 @@ case $# in
		;;
esac

if [ -L $inputfile ]; then
	inputfile=$(readlink -f $inputfile)
fi
tmpf=${inputfile}~

[ -w "${inputfile}" ] || { error "\`${inputfile}' not writeable"; exit 1; }