summaryrefslogtreecommitdiff
path: root/test
diff options
context:
space:
mode:
authorMichael Drake <tlsa@netsurf-browser.org>2022-12-31 19:55:38 +0000
committerMichael Drake <mdrake.unique@gmail.com>2023-01-01 18:02:44 +0000
commitffec523aa0a938beab7def1893d41685e28d2b34 (patch)
treed58877250bb5cc6d0bbcbb7400f30a34a552803d /test
parentfde3d979ace97bd109fce443b49cbbfa5a9307a2 (diff)
downloadlibnsgif-ffec523aa0a938beab7def1893d41685e28d2b34.tar.gz
libnsgif-ffec523aa0a938beab7def1893d41685e28d2b34.tar.bz2
cli: Allow optional application description
Diffstat (limited to 'test')
-rw-r--r--test/cli.c6
-rw-r--r--test/cli.h1
2 files changed, 7 insertions, 0 deletions
diff --git a/test/cli.c b/test/cli.c
index 8f32228..b1b776f 100644
--- a/test/cli.c
+++ b/test/cli.c
@@ -742,6 +742,12 @@ void cli_help(const struct cli_table *cli, const char *prog_name)
cli__count(cli, &count, &pcount, &max_len, &pmax_len, &phas_desc);
+ if (cli->d != NULL) {
+ fprintf(stderr, "\n");
+ cli__print_wrapping_string(cli->d, 0);
+ fprintf(stderr, "\n");
+ }
+
fprintf(stderr, "\nUsage: %s", prog_name);
if (pcount > 0) {
diff --git a/test/cli.h b/test/cli.h
index d7493e4..ffcd272 100644
--- a/test/cli.h
+++ b/test/cli.h
@@ -73,6 +73,7 @@ struct cli_table {
const struct cli_table_entry *entries;
size_t count;
size_t min_positional;
+ const char *d; /**< Description of this application for help output. */
};
/**