htcp

Properties of water suspended in clouds
git clone git://git.meso-star.fr/htcp.git
Log | Files | Refs | README | LICENSE

commit 8c4dfda8d59008a7fccfb339ae161fd498b89199
parent 20f337f25c078741bd881ef1b1d72652d72e53e8
Author: Vincent Forest <vincent.forest@meso-star.com>
Date:   Tue,  5 Sep 2023 14:44:11 +0200

Complete rewriting of les2htcp short 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/les2htcp.c | 42++++++------------------------------------
1 file changed, 6 insertions(+), 36 deletions(-)

diff --git a/src/les2htcp.c b/src/les2htcp.c @@ -48,43 +48,12 @@ struct args { #define ARGS_DEFAULT__ {NULL,NULL,1.0,4096,0,0,0,0} static const struct args ARGS_DEFAULT = ARGS_DEFAULT__; -static void -print_help(const char* cmd) +static INLINE void +usage(const char* cmd) { ASSERT(cmd); - (void)cmd; - - printf( -"Usage: les2htcp -i INPUT [OPTIONS]\n" -"Convert the LES data stored into INPUT from NetCDF to the htcp fileformat.\n\n"); - printf( -" -c advanced check of the validity of the submitted LES file.\n"); - printf( -" -f overwrite the OUTPUT file if it already exists.\n"); - printf( -" -h display this help and exit.\n"); - printf( -" -i INPUT path of the LES file to convert.\n"); - printf( -" -m FLT_TO_METER scale factor to convert from floating point units to\n" -" meters. By default, it is set to %g.\n", - ARGS_DEFAULT.fp_to_meter); - printf( -" -o OUTPUT write results to OUTPUT. If not defined, write results to\n" -" standard output.\n"); - printf( -" -p targeted page size in bytes. Must be a power of 2. By\n" -" default, the page size is %li Bytes.\n", - ARGS_DEFAULT.pagesize); - printf( -" -q do not write results to OUTPUT.\n"); - printf( -" -v display version information and exit.\n"); - printf("\n"); - printf( -"les2htcp is free software released under the GNU GPL license, version 3 or\n" -"later. You are free to change or redistribute it under certain conditions\n" -"<http://gnu.org/licenses/gpl.html>\n"); + printf("usage: %s [-cfhqv] [-m float_to_meter] [-o output] [-p pagesize] " + "-i netcdf\n", cmd); } static void @@ -106,7 +75,7 @@ args_init(struct args* args, const int argc, char** argv) case 'c': args->check = 1; break; case 'f': args->force_overwrite = 1; break; case 'h': - print_help(argv[0]); + usage(argv[0]); args_release(args); args->quit = 1; goto exit; @@ -151,6 +120,7 @@ args_init(struct args* args, const int argc, char** argv) exit: return res; error: + usage(argv[0]); args_release(args); goto exit; }