diff options
author | Shav Kinderlehrer <[email protected]> | 2023-04-17 22:04:03 -0400 |
---|---|---|
committer | Shav Kinderlehrer <[email protected]> | 2023-04-17 22:04:03 -0400 |
commit | b60ecd747be86ae034538b64968c089a3149a4e5 (patch) | |
tree | 8f589e2decd68fb54bed6e1712474f0145037fd5 /src/main.c | |
parent | f8bdf764b2a532e878f47010428aee534793dd5f (diff) | |
download | lat-b60ecd747be86ae034538b64968c089a3149a4e5.tar.gz lat-b60ecd747be86ae034538b64968c089a3149a4e5.zip |
Add argsv0.9.0
- --headers
Diffstat (limited to 'src/main.c')
-rw-r--r-- | src/main.c | 9 |
1 files changed, 6 insertions, 3 deletions
@@ -27,7 +27,9 @@ void run(FILE *fp, char *filename, bool tty) { f.binary = !f.binary; } - if (tty) { + conf.headers = conf.headers && tty; // tty still overrides user + + if (conf.headers) { char *addon = f.binary ? "<binary>" : ""; fprintf(stderr, "\r\x1b[2K%s%s%s%s\r\n", invert_t, basename(filename), addon, reset); @@ -60,7 +62,7 @@ void run(FILE *fp, char *filename, bool tty) { fflush(stdout); // prevent timing inconsistencies between stdout and stderr - if (tty) { + if (conf.headers) { float rounded; char *format = formatbytes(f.buflen, &rounded); @@ -71,10 +73,11 @@ void run(FILE *fp, char *filename, bool tty) { void initconf(void) { conf.stdin = false; conf.force_binary = false; + conf.has_read_stdin = false; conf.process = true; + conf.headers = true; conf.color = true; conf.lines = true; - conf.has_read_stdin = false; } void clearstdin(void) { |