Skip to content

Commit

Permalink
update README help, remove last of line buffering
Browse files Browse the repository at this point in the history
  • Loading branch information
mike-ward committed Jul 8, 2024
1 parent 1afd615 commit d24e807
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 6 deletions.
5 changes: 3 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -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]
Expand Down Expand Up @@ -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 <string> 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
Expand Down
6 changes: 2 additions & 4 deletions lsv/format.v
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
import arrays
import os
import strings
import term
import v.mathutil

Expand Down Expand Up @@ -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 {
Expand Down

0 comments on commit d24e807

Please sign in to comment.