diff options
| author | B. Watson <urchlay@slackware.uk> | 2025-12-09 02:09:14 -0500 |
|---|---|---|
| committer | B. Watson <urchlay@slackware.uk> | 2025-12-09 02:09:14 -0500 |
| commit | d9d6139231719aeee09e8ef90d247784756a1aeb (patch) | |
| tree | 4fa0fb8c6bada6b7018673484aa013db3b2631c5 | |
| parent | 818fcfb56c658017765eafb2078116392d13aa76 (diff) | |
| download | alftools-d9d6139231719aeee09e8ef90d247784756a1aeb.tar.gz | |
alf: Make -v do what -vv did, and -vv do what -vvv did. Also, cosmetics.
| -rw-r--r-- | src/alf.1 | 16 | ||||
| -rw-r--r-- | src/alf.c | 5 | ||||
| -rw-r--r-- | src/alf.rst | 12 | ||||
| -rw-r--r-- | src/alfusage.c | 5 | ||||
| -rw-r--r-- | src/crunch.c | 10 |
5 files changed, 28 insertions, 20 deletions
@@ -27,7 +27,7 @@ level margin: \\n[rst2man-indent\\n[rst2man-indent-level]] .\" new: \\n[rst2man-indent\\n[rst2man-indent-level]] .in \\n[rst2man-indent\\n[rst2man-indent-level]]u .. -.TH "ALF" 1 "2025-12-08" "0.4.0" "Urchlay's Atari 8-bit Tools" +.TH "ALF" 1 "2025-12-09" "0.4.0" "Urchlay's Atari 8-bit Tools" .SH NAME alf \- create Atari 8-bit ALF archives .\" RST source for alf(1) man page. Convert with: @@ -69,7 +69,7 @@ careful not to add a file with the same name as as existing member of the archive. If \fIalf\-file\fP doesn\(aqt exist, it will be created. No backup is made with \fB\-a\fP\&. .UNINDENT -.\" append to alf file. +.\" append to ALF file. . .INDENT 0.0 .TP @@ -93,7 +93,7 @@ Show built\-in help message. .B \-o Overwrite \fIalf\-file\fP if it exists; do not make a \fB~\fP backup. .UNINDENT -.\" overwrite alf file if exists (do not create file~ backup). +.\" overwrite ALF file if it exists (don't create file~ backup). . .INDENT 0.0 .TP @@ -120,9 +120,13 @@ date and midnight for the time. .INDENT 0.0 .TP .B \-v -Verbose operation. Shows more information about what \fBalf\fP is doing. -Can be given twice for more detail, or 3 times to dump the token -tables (\fIlots\fP of output; for debugging only). +Verbose operation. Shows more information about what \fBalf\fP +is doing. Can be given twice to dump the token tables (\fIlots\fP of +output; for debugging only). +.UNINDENT +.\" verbose (-vv: debug). +. +.INDENT 0.0 .TP .B \-V\fP,\fB \-\-version Show \fBalf\fP version number and exit. @@ -267,7 +267,8 @@ void usage(void) { char **line; puts("alf (ALF compressor) v" VERSION " by B. Watson, WTFPL."); - printf("Usage: %s [-a|-o] archive.alf file [file ...]\n", self); + printf("Usage: %s [-a|-o] archive.alf file[=NAME] [file[=NAME] ...]\n", self); + puts("Use file=NAME to set the filenames in the ALF archive."); puts("Options:"); for(line = usage_msg; *line; line++) @@ -359,7 +360,7 @@ int main(int argc, char **argv) { if(out_file) fclose(out_file); - if(opt_verbose > 1) { + if(opt_verbose) { if(file_count > 1) { printf("Compressed %d file%s: ", file_count, file_count == 1 ? "" : "s"); printf("%u/%u (%d%%)\n", diff --git a/src/alf.rst b/src/alf.rst index 0756d95..32893a6 100644 --- a/src/alf.rst +++ b/src/alf.rst @@ -57,7 +57,7 @@ OPTIONS the archive. If *alf-file* doesn't exist, it will be created. No backup is made with **-a**. -.. append to alf file. +.. append to ALF file. -A Convert line endings and tabs from ASCII to ATASCII in all input @@ -75,7 +75,7 @@ OPTIONS -o Overwrite *alf-file* if it exists; do not make a **~** backup. -.. overwrite alf file if exists (do not create file~ backup). +.. overwrite ALF file if it exists (don't create file~ backup). **-td** Use default **LZ.COM** timestamps (8 Dec 82 12:24). @@ -94,9 +94,11 @@ OPTIONS .. use zero timestamps. -v - Verbose operation. Shows more information about what **alf** is doing. - Can be given twice for more detail, or 3 times to dump the token - tables (*lots* of output; for debugging only). + Verbose operation. Shows more information about what **alf** + is doing. Can be given twice to dump the token tables (*lots* of + output; for debugging only). + +.. verbose (-vv: debug). -V, --version Show **alf** version number and exit. diff --git a/src/alfusage.c b/src/alfusage.c index 98eb6f2..c5e32aa 100644 --- a/src/alfusage.c +++ b/src/alfusage.c @@ -1,11 +1,12 @@ const char *usage_msg[] = { - " -a: append to alf file.", + " -a: append to ALF file.", " -A: convert EOLs and tabs in all input files.", " -h: show this help message.", - " -o: overwrite alf file if exists (do not create file~ backup).", + " -o: overwrite ALF file if it exists (don't create file~ backup).", " -td: use default LZ.COM timestamps.", " -tu: use UTC timestamps.", " -tz: use zero timestamps.", + " -v: verbose (-vv: debug).", " -V: show version number.", (const char*)0 }; diff --git a/src/crunch.c b/src/crunch.c index b450ae0..fc4d6e9 100644 --- a/src/crunch.c +++ b/src/crunch.c @@ -130,7 +130,7 @@ void append_bit(int bit) { void store_token(int tok) { int mask; - if(opt_verbose > 2) { + if(opt_verbose > 1) { printf("<%d >%d:%d #%d\n", in_pos, output_len, out_bitpos, tok); } @@ -200,11 +200,11 @@ void make_token(token_t *oldtok, u8 newchr) { /* if the token table is full, reset it. basically start over like we would with a new file. */ if(curr_token == max_token) { - if(opt_verbose > 2) { + if(opt_verbose > 1) { printf("\ntoken %d won't fit in %d bits, ", max_token, token_bits); } if(token_bits == MAX_BITS) { - if(opt_verbose > 2) { + if(opt_verbose > 1) { printf("resetting token_bits to %d\n", INITIAL_BITS); printf("token table is full, clearing, old contents:\n"); dump_tokens(); @@ -215,7 +215,7 @@ void make_token(token_t *oldtok, u8 newchr) { return; /* since we're starting over, *don't* make a token */ } else { token_bits++; - if(opt_verbose > 2) { + if(opt_verbose > 1) { printf("token_bits increased to %d\n", token_bits); } } @@ -253,7 +253,7 @@ void crunch(void) { store_token(TOK_END); if(out_bitpos) inc_output_len(); - if(opt_verbose > 2) { + if(opt_verbose > 1) { printf("\nfinal token table contents:\n"); dump_tokens(); } |
