Skip to content

Commit

Permalink
Merge pull request #1028 from xexyl/quiet
Browse files Browse the repository at this point in the history
Add missing option -q to txzchk
  • Loading branch information
lcn2 authored Nov 16, 2024
2 parents 805f390 + 479cb70 commit 42a9b98
Show file tree
Hide file tree
Showing 10 changed files with 24 additions and 10 deletions.
5 changes: 5 additions & 0 deletions CHANGES.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,10 @@
# Major changes to the IOCCC entry toolkit

## Release 1.6.12 2024-11-16

Add missing `-q` option to `txzchk`.


## Release 1.6.11 2024-11-15

Fixes and improvements in `jparse` synced from the [jparse
Expand Down
2 changes: 1 addition & 1 deletion chkentry.c
Original file line number Diff line number Diff line change
Expand Up @@ -58,7 +58,7 @@ static const char * const usage_msg =
"\t-v level\tset verbosity level (def level: %d)\n"
"\t-J level\tset JSON verbosity level (def level: %d)\n"
"\t-V\t\tprint version string and exit\n"
"\t-q\t\tquiet mode (def: not quiet)\n"
"\t-q\t\tquiet mode (def: loud :-) )\n"
"\t\t\t NOTE: -q will also silence msg(), warn(), warnp() if -v 0\n"
"\n"
"\tinfo.json\tcheck info.json file, . ==> skip IOCCC .info.json style check\n"
Expand Down
2 changes: 1 addition & 1 deletion mkiocccentry.c
Original file line number Diff line number Diff line change
Expand Up @@ -106,7 +106,7 @@ static const char * const usage_msg0 =
"\t-h\t\tprint help message and exit\n"
"\t-v level\tset verbosity level: (def level: %d)\n"
"\t-J level\tset JSON verbosity level (def level: %d)\n"
"\t-q\t\tquiet mode (def: not quiet)\n"
"\t-q\t\tquiet mode (def: loud :-) )\n"
"\t\t\t NOTE: -q will also silence msg(), warn(), warnp() if -v 0\n"
"\t-V\t\tprint version string and exit\n"
"\t-W\t\tignore all warnings (this does NOT mean the judges will! :) )\n"
Expand Down
7 changes: 6 additions & 1 deletion soup/man/man1/txzchk.1
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@
.\" "Share and Enjoy!"
.\" -- Sirius Cybernetics Corporation Complaints Division, JSON spec department. :-)
.\"
.TH txzchk 1 "11 July 2024" "txzchk" "IOCCC tools"
.TH txzchk 1 "16 November 2024" "txzchk" "IOCCC tools"
.SH NAME
.B txzchk
\- sanity checker tool used on IOCCC compressed tarballs
Expand All @@ -35,6 +35,7 @@
.RB [\| \-h \|]
.RB [\| \-v
.IR level \|]
.RB [\| \-q \|]
.RB [\| \-e \|]
.RB [\| \-f
.IR feathers \|]
Expand Down Expand Up @@ -85,6 +86,10 @@ Show help and exit.
.BI \-v\ level
Set verbosity level.
.TP
.B \-q
Quiet mode.
Silence msg(), warn(), warnp() if verbosity level is 0.
.TP
.B \-e
Entertainment (or if you prefer, Easter egg) mode.
.TP
Expand Down
2 changes: 1 addition & 1 deletion soup/version.h
Original file line number Diff line number Diff line change
Expand Up @@ -66,7 +66,7 @@
*
* NOTE: This should match the latest Release string in CHANGES.md
*/
#define MKIOCCCENTRY_REPO_VERSION "1.6.11 2024-11-15" /* special release format: major.minor.patch YYYY-MM-DD */
#define MKIOCCCENTRY_REPO_VERSION "1.6.12 2024-11-16" /* special release format: major.minor.patch YYYY-MM-DD */


/*
Expand Down
2 changes: 1 addition & 1 deletion test_ioccc/chkentry_test.sh
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,7 @@ export USAGE="usage: $0 [-h] [-V] [-v level] [-D dbg_level] [-J level] [-q] [-c
-v level set verbosity level for this script: (def level: 0)
-D dbg_level set verbosity level for tests (def: level: 0)
-J level set JSON parser verbosity level (def level: 0)
-q quiet mode: silence msg(), warn(), warnp() if -v 0 (def: not quiet)
-q quiet mode: silence msg(), warn(), warnp() if -v 0 (def: loud :-) )
-c chkentry path to chkentry tool (def: $CHKENTRY)
-d json_tree test files json_tree/{info,auth}.json/{good,bad}/*.json (def: $JSON_TREE)
Expand Down
2 changes: 1 addition & 1 deletion test_ioccc/fnamchk.c
Original file line number Diff line number Diff line change
Expand Up @@ -63,7 +63,7 @@ static const char * const usage_msg =
"\n"
"\t-h\t\t\tprint help message and exit\n"
"\t-v level\t\tset verbosity level: (def level: %d)\n"
"\t-q\t\t\tquiet mode: silence msg(), warn(), warnp() if -v 0 (def: not quiet)\n"
"\t-q\t\t\tquiet mode: silence msg(), warn(), warnp() if -v 0 (def: loud :-) )\n"
"\t-V\t\t\tprint version string and exit\n"
"\t-E ext\t\t\tchange extension to test (def: txz)\n"
"\t-t\t\t\tfilename must match test submit filename\n"
Expand Down
2 changes: 1 addition & 1 deletion test_ioccc/man/man8/utf8_test.8
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@ Set verbosity level to
Print version string and exit.
.TP
.B \-q
Suppresses some of the output (def: not quiet).
Suppresses some of the output (def: loud :-) ).
.SH EXIT STATUS
.TP
0
Expand Down
2 changes: 1 addition & 1 deletion test_ioccc/utf8_test.c
Original file line number Diff line number Diff line change
Expand Up @@ -95,7 +95,7 @@ static char const * const usage_msg =
"\t-h\t\tPrint help message and exit\n"
"\t-v level\tSet verbosity level: (def level: 0)\n"
"\t-V\t\tPrint version string and exit\n"
"\t-q\t\tQuiet mode: silence msg(), warn(), warnp() if -v 0 (def: not quiet)\n"
"\t-q\t\tQuiet mode: silence msg(), warn(), warnp() if -v 0 (def: loud :-) )\n"
"\n"
"\tname\t\tUTF-8 name to translate into POSIX portable filename and + chars\n"
"\n"
Expand Down
8 changes: 6 additions & 2 deletions txzchk.c
Original file line number Diff line number Diff line change
Expand Up @@ -88,10 +88,11 @@ static struct txz_file *txz_files; /* linked list of the files in the tarball *
* Use the usage() function to print the usage_msg([0-9]?)+ strings.
*/
static const char * const usage_msg =
"usage: %s [-h] [-v level] [-e] [-f feathers] [-w] [-V] [-t tar] [-F fnamchk] [-T] [-E ext] tarball_path\n"
"usage: %s [-h] [-v level] [-q] [-e] [-f feathers] [-w] [-V] [-t tar] [-F fnamchk] [-T] [-E ext] tarball_path\n"
"\n"
"\t-h\t\tprint help message and exit\n"
"\t-v level\tset verbosity level: (def level: %d)\n"
"\t-q\t\tquiet mode: silence msg(), warn(), warnp() if -v 0 (def: loud :-) )\n"
"\t-e\t\tentertainment mode (def: be boring :-) )\n"
"\t-f feathers\tdefine how many feathers is feathery (for -e)\n"
"\t-w\t\talways show warning messages\n"
Expand Down Expand Up @@ -138,7 +139,7 @@ main(int argc, char **argv)
* parse args
*/
program = argv[0];
while ((i = getopt(argc, argv, ":hv:VF:t:TE:wef:")) != -1) {
while ((i = getopt(argc, argv, ":hv:qVF:t:TE:wef:")) != -1) {
switch (i) {
case 'h': /* -h - print help to stderr and exit 2 */
usage(2, program, ""); /*ooo*/
Expand All @@ -154,6 +155,9 @@ main(int argc, char **argv)
not_reached();
}
break;
case 'q':
msg_warn_silent = true;
break;
case 'V': /* -V - print version and exit 2 */
print("%s version: %s\n", TXZCHK_BASENAME, TXZCHK_VERSION);
print("jparse UTF-8 version: %s\n", JPARSE_UTF8_VERSION);
Expand Down

0 comments on commit 42a9b98

Please sign in to comment.