From e97639fe47faed62703ba47c1071b91e3d76eb41 Mon Sep 17 00:00:00 2001 From: Michael Adams Date: Thu, 3 Nov 2022 18:13:53 -0700 Subject: [PATCH] Fixes #342, #343, #344. Some command-line options for the jasper, imginfo, imgcmp, and jiv programs (that are not deemed to be for internal use only) were not documented in the manual. Descriptions for these options have now been added to the manual. The help information message printed by each of the jasper, imginfo, imgcmp, and jiv programs has been improved. A mention of the URL for the online documentation is now included in all help messages. A comment has also been added indicating that not all options are listed in the help message and that the manual should be checked for a complete list of options (excluding, of course, the ones that are deemed to be for internal use only and are deliberately undocumented). --- doc/src/apps_imgcmp.dox | 15 +++++++++++++++ doc/src/apps_jiv.dox | 12 ++++++++++++ src/app/imgcmp.c | 22 ++++++++++++++++------ src/app/imginfo.c | 19 ++++++++++++------- src/app/jasper.c | 7 +++---- src/app/jiv.c | 4 +++- src/libjasper/include/jasper/jas_version.h | 6 +++--- 7 files changed, 64 insertions(+), 21 deletions(-) diff --git a/doc/src/apps_imgcmp.dox b/doc/src/apps_imgcmp.dox index 0dd87019..617f9117 100644 --- a/doc/src/apps_imgcmp.dox +++ b/doc/src/apps_imgcmp.dox @@ -18,6 +18,15 @@ components, component subsampling factors, etc.). The following options are supported: + - `--help` + - Print help information and exit. + + - `--version` + - Display the version information and exit. + + - `--verbose` + - Increase the verbosity level. + - `-f $file` - Read the primary (i.e., reference) image (for comparison purposes) from the file named `$file`. @@ -37,6 +46,12 @@ The following options are supported: - `mae`: mean absolute error (MAE) - `equal`: equality + - `--memory-limit $n` + - Set the memory limit to `$n` bytes. + + - `--debug-level $level` + - Set the debug level to `$level`. + The `-f` and `-F` options must always be specified. There is currently no way to explicitly specify the format of the images. If the format of either image cannot be autodetected, the command will diff --git a/doc/src/apps_jiv.dox b/doc/src/apps_jiv.dox index 72b9ee23..f96ced55 100644 --- a/doc/src/apps_jiv.dox +++ b/doc/src/apps_jiv.dox @@ -26,8 +26,20 @@ The following options are supported: - `--help` - Print help information and exit. + - `--version` + - Display the version information and exit. + - `--wait $n` - Automatically step from one image to the next, pausing for `$n` seconds in between. + - `--loop` + - Repeatedly cycle through the specified images. + + - `--memory-limit $n` + - Set the memory limit to `$n` bytes. + + - `--debug-level $level` + - Set the debug level to `$level`. + */ diff --git a/src/app/imgcmp.c b/src/app/imgcmp.c index 99529a1e..714eeb72 100644 --- a/src/app/imgcmp.c +++ b/src/app/imgcmp.c @@ -694,14 +694,24 @@ void cmdinfo() void usage() { + static const char helpinfo[] = { + "Some of the supported options include:\n" + " -f $file\n" + " Set the pathname of reference image file to $file.\n" + " -F $other_image_file\n" + " Set pathname of the other image file to $file.\n" + " -m $metric\n" + " Set the metric to $metric.\n" + "For additional information, please see the online documentation.\n" + }; cmdinfo(); - fprintf(stderr, "usage:\n"); - fprintf(stderr,"%s ", cmdname); + fprintf(stderr, "\n"); + fprintf(stderr, "%s\n", JAS_NOTES); + fprintf(stderr, "usage: %s [options]\n", cmdname); + fprintf(stderr, "\n"); + fprintf(stderr, "%s\n", helpinfo); fprintf(stderr, - "-f reference_image_file -F other_image_file [-m metric]\n" - ); - fprintf(stderr, - "The metric argument may assume one of the following values:\n" + "The metric specifier may assume one of the following values:\n" " psnr .... peak signal to noise ratio\n" " mse ..... mean squared error\n" " rmse .... root mean squared error\n" diff --git a/src/app/imginfo.c b/src/app/imginfo.c index 41ee0c53..0654925b 100644 --- a/src/app/imginfo.c +++ b/src/app/imginfo.c @@ -382,8 +382,16 @@ static void cmdinfo() static void usage() { static const char help[] = { - "Options:\n" + "Some supported options include:\n" " --help\n" + " --version\n" + " Display the version information and exit.\n" + " --verbose\n" + " Increase the verbosity level.\n" + " -f $file\n" + " Read the input image from the file $file.\n" + " --list-enabled-formats\n" + " Print the names of all of the enabled image formats.\n" " --memory-limit $n\n" " Set the memory limit to $n bytes.\n" " --debug-level $level\n" @@ -392,14 +400,11 @@ static void usage() " Set the maximum number of samples for decoding to $n\n" " --decoder-option $string\n" " Add the option $string to the list of decoder options.\n" - " --verbose\n" - " Increase the verbosity level.\n" - " --version\n" - " Display the version information and exit.\n" - " -f $file\n" - " Read the input image from the file $file.\n" + "For additional information, please see the online documentation.\n" }; cmdinfo(); + fprintf(stderr, "\n"); + fprintf(stderr, "%s\n", JAS_NOTES); fprintf(stderr, "usage:\n"); fprintf(stderr,"%s ", cmdname); fprintf(stderr, "[-f image_file]\n"); diff --git a/src/app/jasper.c b/src/app/jasper.c index 7c8981d0..4b5ce3cd 100644 --- a/src/app/jasper.c +++ b/src/app/jasper.c @@ -592,7 +592,7 @@ void cmdinfo() } static const char *const helpinfo[] = { -"The following options are supported:\n", +"Some of the supported options include:\n", " --help Print this help information and exit.\n", " --version Print version information and exit.\n", " --verbose Enable verbose mode.\n", @@ -608,9 +608,7 @@ static const char *const helpinfo[] = { " (See below for the list of supported formats.)\n", " --output-option $opt Provide the option $opt to the encoder.\n", " --force-srgb Force conversion to the sRGB color space.\n", -"Some of the above option names can be abbreviated as follows:\n", -" --input = -f, --input-format = -t, --input-option = -o,\n", -" --output = -F, --output-format = -T, --output-option = -O\n", +"For additional information, please see the online documentation.\n", 0 }; @@ -623,6 +621,7 @@ void cmdusage() for (i = 0, s = helpinfo[i]; s; ++i, s = helpinfo[i]) { fprintf(stderr, "%s", s); } + fprintf(stderr, "\n"); fprintf(stderr, "The following formats are supported:\n"); int fmtind; diff --git a/src/app/jiv.c b/src/app/jiv.c index 39ed6867..8838b067 100644 --- a/src/app/jiv.c +++ b/src/app/jiv.c @@ -374,15 +374,17 @@ static void cmdinfo() JAS_VERSION); fprintf(stderr, "Copyright (c) 2002-2003 Michael David Adams.\n" "All rights reserved.\n"); + fprintf(stderr, "\n"); fprintf(stderr, "%s\n", JAS_NOTES); } static const char *const helpinfo[] = { -"The following options are supported:\n", +"Some of the supported options include:\n", " --help Print this help information and exit.\n", " --version Print version information and exit.\n", " --loop Loop indefinitely through images.\n", " --wait N Advance to next image after N seconds.\n", +"For additional information, please see the online documentation.\n", 0 }; diff --git a/src/libjasper/include/jasper/jas_version.h b/src/libjasper/include/jasper/jas_version.h index e65ad0cf..e82c34e1 100644 --- a/src/libjasper/include/jasper/jas_version.h +++ b/src/libjasper/include/jasper/jas_version.h @@ -87,11 +87,11 @@ extern "C" { "All rights reserved.\n" #define JAS_NOTES \ - "For more information about this software, please visit the following\n" \ - "web sites/pages:\n" \ + "For information about the JasPer project, see:\n" \ " https://jasper-software.github.io/jasper\n" \ - " https://jasper-software.github.io/jasper-manual\n" \ " https://www.ece.uvic.ca/~mdadams/jasper\n" \ + "For online documentation on the JasPer software, see:\n" \ + " https://jasper-software.github.io/jasper-manual\n" \ "Please submit bug reports using the bug-tracker at:\n" \ " https://github.com/jasper-software/jasper/issues\n"