diff options
author | Thomas Voss <mail@thomasvoss.com> | 2024-08-26 09:16:09 +0200 |
---|---|---|
committer | Thomas Voss <mail@thomasvoss.com> | 2024-08-26 09:16:09 +0200 |
commit | 8307642c8c0dab1dcfccb5f36b4e5e5e3f4f12be (patch) | |
tree | 0032cf65826c1887a6625827a3579d2c1bae839b /src | |
parent | eba151c179fa55f74a1e492cf36513ee636954ed (diff) |
Half-implement -h
Diffstat (limited to 'src')
-rw-r--r-- | src/main.c | 7 |
1 files changed, 6 insertions, 1 deletions
@@ -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 |