libmicrohttpd2

HTTP server C library (MHD 2.x, alpha)
Log | Files | Refs | README | LICENSE

commit 7f9b410904b4e93c2c20071396a745198ca63ea1
parent 86e0ab38d04baf3afd70db67a6529c7060bb712e
Author: Evgeny Grin (Karlson2k) <k2k@drgrin.dev>
Date:   Sun, 15 Jun 2025 21:22:51 +0200

perf_replies: added short params for help, formatted help text

Diffstat:
Msrc/tools/perf_replies.c | 63++++++++++++++++++++++++++++++++++-----------------------------
1 file changed, 34 insertions(+), 29 deletions(-)

diff --git a/src/tools/perf_replies.c b/src/tools/perf_replies.c @@ -321,48 +321,49 @@ show_help (void) printf ("Start MHD2-based web-server optimised for fast replies.\n"); printf ("\n"); printf ("Threading options (mutually exclusive):\n"); - printf (" -A, --all-cpus use all available CPU cores (for \n" - " testing with remote client)\n"); - printf (" -t NUM, --threads=NUM use NUM threads\n"); + printf (" -A, --all-cpus use all available CPU cores (for \n" + " testing with remote client)\n"); + printf (" -t NUM, --threads=NUM use NUM threads\n"); #if 0 /* disabled code */ - printf (" -P, --thread-per-conn use thread-per-connection mode,\n" - " the number of threads is limited only\n" - " by the number of connection\n"); + printf (" -P, --thread-per-conn use thread-per-connection mode,\n" + " the number of threads is limited\n" + " only by the number of connection\n"); #endif /* disabled code */ printf ("\n"); printf ("Force polling function (mutually exclusive):\n"); if (MHD_NO != mhdl_info.v_types_sockets_polling.tech_epoll) - printf (" -e, --epoll use 'epoll' functionality\n"); + printf (" -e, --epoll use 'epoll' functionality\n"); if (MHD_NO != mhdl_info.v_types_sockets_polling.func_poll) - printf (" -p, --poll use poll() function\n"); + printf (" -p, --poll use poll() function\n"); if (MHD_NO != mhdl_info.v_types_sockets_polling.func_select) - printf (" -s, --select use select() function\n"); + printf (" -s, --select use select() function\n"); printf ("\n"); printf ("Response body size options (mutually exclusive):\n"); - printf (" -E, --empty empty response, 0 bytes\n"); - printf (" -T, --tiny tiny response, 3 bytes (default)\n"); - printf (" -M, --medium medium response, 8 KiB\n"); - printf (" -L, --large large response, 1 MiB\n"); - printf (" -X, --xlarge extra large response, 8 MiB\n"); - printf (" -J, --jumbo jumbo response, 101 MiB\n"); + printf (" -E, --empty empty response, 0 bytes\n"); + printf (" -T, --tiny tiny response, 3 bytes (default)\n"); + printf (" -M, --medium medium response, 8 KiB\n"); + printf (" -L, --large large response, 1 MiB\n"); + printf (" -X, --xlarge extra large response, 8 MiB\n"); + printf (" -J, --jumbo jumbo response, 101 MiB\n"); printf ("\n"); printf ("Response use options (mutually exclusive):\n"); - printf (" -S, --shared pool of pre-generated shared response\n" - " objects (default)\n"); - printf (" -I, --single single pre-generated response object\n" - " used for all requests\n"); - printf (" -U, --unique response object generated for every\n" - " request and used one time only\n"); + printf (" -S, --shared pool of pre-generated shared\n" + " response objects (default)\n"); + printf (" -I, --single single pre-generated response\n" + " object used for all requests\n"); + printf (" -U, --unique response object generated for every\n" + " request and used one time only\n"); printf ("\n"); printf ("Other options:\n"); - printf (" -c NUM, --connections=NUM reject more than NUM client \n" - " connections\n"); - printf (" -O NUM, --timeout=NUM set connection timeout to NUM seconds,\n" - " zero means no timeout\n"); - printf (" --date-header use the 'Date:' header in every\n" - " reply\n"); - printf (" --help display this help and exit\n"); - printf (" -V, --version output version information and exit\n"); + printf (" -c NUM, --connections=NUM reject more than NUM client\n" + " connections\n"); + printf (" -O NUM, --timeout=NUM set connection timeout to NUM\n" + " seconds, zero means no timeout\n"); + printf (" --date-header use the 'Date:' header in every\n" + " reply\n"); + printf (" -h, -?, --help display this help and exit\n"); + printf (" -V, --version output version information and\n" + " exit\n"); printf ("\n"); printf ("This tool is part of GNU libmicrohttpd suite.\n"); printf ("%s\n", tool_copyright); @@ -1010,6 +1011,10 @@ process_short_param (const char *param, const char *next_param) return process_param__connections ("-c", param + 1, next_param); else if ('O' == param_chr) return process_param__timeout ("-O", param + 1, next_param); + else if ('h' == param_chr) + return process_param__help ("-h"); + else if ('?' == param_chr) + return process_param__help ("-?"); else if ('V' == param_chr) return process_param__version ("-V");