summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--test/nsgif.c24
1 files changed, 19 insertions, 5 deletions
diff --git a/test/nsgif.c b/test/nsgif.c
index 53c6a68..f873bab 100644
--- a/test/nsgif.c
+++ b/test/nsgif.c
@@ -29,15 +29,17 @@ static struct nsgif_options {
uint64_t loops;
bool palette;
bool info;
+ bool help;
} nsgif_options;
static const struct cli_table_entry cli_entries[] = {
{
- .s = 'm',
- .l = "ppm",
- .t = CLI_STRING,
- .v.s = &nsgif_options.ppm,
- .d = "Convert frames to PPM image at given path."
+ .s = 'h',
+ .l = "help",
+ .t = CLI_BOOL,
+ .no_pos = true,
+ .v.b = &nsgif_options.help,
+ .d = "Print this text.",
},
{
.s = 'i',
@@ -55,6 +57,13 @@ static const struct cli_table_entry cli_entries[] = {
"The default is 1."
},
{
+ .s = 'm',
+ .l = "ppm",
+ .t = CLI_STRING,
+ .v.s = &nsgif_options.ppm,
+ .d = "Convert frames to PPM image at given path."
+ },
+ {
.s = 'p',
.l = "palette",
.t = CLI_BOOL,
@@ -358,6 +367,11 @@ int main(int argc, char *argv[])
return EXIT_FAILURE;
}
+ if (nsgif_options.help) {
+ cli_help(&cli, argv[0]);
+ return EXIT_SUCCESS;
+ }
+
if (nsgif_options.ppm != NULL) {
ppm = fopen(nsgif_options.ppm, "w+");
if (ppm == NULL) {