From d24e80780641181f158075690fcaa0f537fe3e93 Mon Sep 17 00:00:00 2001 From: mike-ward Date: Mon, 8 Jul 2024 05:35:31 -0500 Subject: [PATCH] update README help, remove last of line buffering --- README.md | 5 +++-- lsv/format.v | 6 ++---- 2 files changed, 5 insertions(+), 6 deletions(-) diff --git a/README.md b/README.md index cf61a56..1e79fb0 100644 --- a/README.md +++ b/README.md @@ -43,7 +43,7 @@ I tried several times to submit to Homebrew but could never get past the CI. Ple ## Help ``` -lsv 2024.3 +lsv 2024.4 ----------------------------------------------- Usage: lsv [options] [FILES] @@ -88,9 +88,10 @@ Long Listing Options: -I show time in iso format -J show time in compact format -N show inodes + -Z do not wrap long lines + --cs show file checksum (md5, sha1, sha224, sha256, sha512, blake2b) - --no-counts hide file/dir counts --no-date hide date (modified) --no-dim hide shading; useful for light backgrounds diff --git a/lsv/format.v b/lsv/format.v index 909ea11..f2ded4a 100644 --- a/lsv/format.v +++ b/lsv/format.v @@ -1,6 +1,5 @@ import arrays import os -import strings import term import v.mathutil @@ -73,13 +72,12 @@ fn format_one_per_line(entries []Entry, options Options) { } fn format_with_commas(entries []Entry, options Options) { - mut line := strings.new_builder(200) last := entries.len - 1 for i, entry in entries { content := if i < last { '${entry.name}, ' } else { entry.name } - line.write_string(format_cell(content, 0, .left, no_style, options)) + print(format_cell(content, 0, .left, no_style, options)) } - println(line) + print_newline() } fn format_cell(s string, width int, align Align, style Style, options Options) string {