ste

Једноставни уређивач табела
git clone https://git.sr.ht/~strahinja/ste
Дневник | Датотеке | Референце | ПРОЧИТАЈМЕ | ЛИЦЕНЦА

чување a812a36d474b852ffdf6d171f293d1f62ac204e6
родитељ a3efcfda1cfd8e89a609c86a075aa6bf6e439b02
Аутор: Страхиња Радић <contact@strahinja.org>
Датум:   Sat, 11 Nov 2023 16:27:43 +0100

Handle symlinks correctly, like sled (operate on destination)

Signed-off-by: Страхиња Радић <contact@strahinja.org>

Diffstat:
MTODO | 4----
MTODO.done | 4++++
Atest/symlink.tsv | 2++
Mtsvdel | 3+++
Mtsvedit | 3+++
Mtsvins | 3+++
Mtsvmove | 3+++
измењених датотека: 7, додавања: 18(+), брисања: 4(-)

diff --git a/TODO b/TODO @@ -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]? diff --git a/TODO.done b/TODO.done @@ -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 diff --git a/test/symlink.tsv b/test/symlink.tsv @@ -0,0 +1 @@ +test.tsv +\ No newline at end of file diff --git a/tsvdel b/tsvdel @@ -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; } diff --git a/tsvedit b/tsvedit @@ -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}") diff --git a/tsvins b/tsvins @@ -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 diff --git a/tsvmove b/tsvmove @@ -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; }