From 8307642c8c0dab1dcfccb5f36b4e5e5e3f4f12be Mon Sep 17 00:00:00 2001 From: Thomas Voss Date: Mon, 26 Aug 2024 09:16:09 +0200 Subject: Half-implement -h --- src/main.c | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) (limited to 'src') diff --git a/src/main.c b/src/main.c index 40318cf..83c27ef 100644 --- a/src/main.c +++ b/src/main.c @@ -44,13 +44,18 @@ main(int argc, char **argv) int opt; static const struct option longopts[] = { {"digits", required_argument, 0, 'd'}, + {"help", no_argument, 0, 'h'}, {"period", required_argument, 0, 'p'}, {0}, }; argv[0] = basename(argv[0]); - while ((opt = getopt_long(argc, argv, "d:p:", longopts, NULL)) != -1) { + while ((opt = getopt_long(argc, argv, "d:hp:", longopts, NULL)) != -1) { switch (opt) { + case 'h': + /* TODO: Open the manual page! */ + usage(argv[0]); + break; case 'd': case 'p': { /* strtol() allows for numbers with leading spaces and a -- cgit v1.2.3