diff options
| -rw-r--r-- | po/da.po | 20 | ||||
| -rw-r--r-- | src/bin/main.c | 30 |
2 files changed, 43 insertions, 7 deletions
@@ -8,8 +8,8 @@ msgid "" msgstr "" "Project-Id-Version: aplwc 0.0.1\n" "Report-Msgid-Bugs-To: petermikkelsen10@gmail.com\n" -"POT-Creation-Date: 2025-11-13 21:01+0100\n" -"PO-Revision-Date: 2025-11-13 21:01+0100\n" +"POT-Creation-Date: 2025-11-13 21:28+0100\n" +"PO-Revision-Date: 2025-11-13 21:30+0100\n" "Last-Translator: Peter Mikkelsen <petermikkelsen10@gmail.com>\n" "Language-Team: Danish\n" "Language: da\n" @@ -27,6 +27,16 @@ msgstr "initialiseret" msgid "exiting" msgstr "afslutter" -#: src/bin/main.c:21 -msgid "No command line arguments expected" -msgstr "Ingen kommandolinjeargumenter forventet" +#: src/bin/main.c:17 +#, c-format +msgid " version %s\n" +msgstr "version %s\n" + +#: src/bin/main.c:24 +msgid "There is no usage text yet." +msgstr "Der er ingen brugs tekst endnu." + +#: src/bin/main.c:45 +#, c-format +msgid "Unknown command-line argument: '%s'\n" +msgstr "Ukendt kommandolinjeargument: '%s'\n" diff --git a/src/bin/main.c b/src/bin/main.c index 5d5ea97..f411862 100644 --- a/src/bin/main.c +++ b/src/bin/main.c @@ -1,5 +1,7 @@ #include <config.h> #include <stdio.h> +#include <stdlib.h> +#include <string.h> #include <aplwc.h> #if ENABLE_NLS @@ -9,6 +11,20 @@ #define _(S) S #endif +static void +version(void) +{ + printf(_(PACKAGE " version %s\n"), PACKAGE_VERSION); + exit(EXIT_SUCCESS); +} + +static void +usage(void) +{ + puts(_("There is no usage text yet.")); + exit(EXIT_SUCCESS); +} + int main(int argc, char *argv[]) { @@ -17,8 +33,18 @@ main(int argc, char *argv[]) aplwc_boot(); - if(argc != 1) - puts(_("No command line arguments expected")); + for(int i = 1; i < argc; i++){ + if(strcmp(argv[i], "--version") == 0) + version(); + else if(strcmp(argv[i], "--help") == 0) + usage(); + else + break; + } + if(argc > 1){ + printf(_("Unknown command-line argument: '%s'\n"), argv[1]); + exit(EXIT_FAILURE); + } aplwc_init_fns(&fns); aplwc = aplwc_init(&fns, NULL); |