htpp

htrdr-image post-processing
git clone git://git.meso-star.fr/htpp.git
Log | Files | Refs | README | LICENSE

commit 7b50b6be9e2c828caf015906c126f1a4cd76abb7
parent 6d2c37ea82f163aa2ca2ce297aff6b285e36e992
Author: Vincent Forest <vincent.forest@meso-star.com>
Date:   Wed, 13 Sep 2023 16:20:05 +0200

Complete rewriting of brief help

Remove the short descriptions of the options, as there is no specific
advantage in displaying them here rather than reading the man page. Only
the command synopsis is given to summarize the use of the command.

Diffstat:
Msrc/htpp.c | 46++++++----------------------------------------
1 file changed, 6 insertions(+), 40 deletions(-)

diff --git a/src/htpp.c b/src/htpp.c @@ -112,47 +112,12 @@ static const struct img IMG_NULL = IMG_NULL__; * Helper functions ******************************************************************************/ static void -print_help(const char* cmd) +usage(void) { - ASSERT(cmd); - - printf( -"Usage: %s [options] [image]\n" -"Post process a htrdr-image(5) and convert the result in a regular PPM\n" -"image or in a gnuplot script. If no image name is defined, read the \n" -"image data from standard input.\n", - cmd); - printf("\n"); - printf( -" -f overwrite the output file if it already exists.\n"); - printf( -" -h display this help and exit.\n"); - printf( -" -i <sub-option>[:<sub-option> ... ]\n" -" post process the colors of the submitted image. The\n" -" first, third, and fifth pixel component are assumed\n" -" to store a color encoded in the CIE 1931 XYZ color\n" -" space ('man htpp' for the list of sub-options).\n"); - printf( -" -m <sub-option>[:<sub-option> ... ]\n" -" map a specific pixel component to a color.\n" -" ('man htpp' for the list of sub-options).\n"); - printf( -" -o <output> write PPM image to <output>. If not defined, write\n" -" results to standard output.\n"); - printf( -" -t <threads-count>\n" -" hint on the number of threads to use.\n" -" By default use as many threads as CPU cores.\n"); - printf( -" -v make the program verbose.\n"); - printf( -" --version display version information and exit.\n"); - printf("\n"); printf( -"htpp is free software released under the GNU GPL license, version 3 or\n" -"later. You are free to change or redistribute it under certain\n" -"conditions <http://gnu.org/licenses/gpl.html>.\n"); +"usage: htpp [-fhVv] [-i image_option[:image_option ...]]\n" +" [-m map_option[:map_option ...]] [-o output]\n" +" [-t threads_count] [input]\n"); } static res_T @@ -342,7 +307,7 @@ args_init(struct args* args, const int argc, char** argv) switch(opt) { case 'f': args->force_overwrite = 1; break; case 'h': - print_help(argv[0]); + usage(); args_release(args); args->quit = 1; goto exit; @@ -388,6 +353,7 @@ exit: optind = 1; return res; error: + usage(); args_release(args); goto exit; }