diff options
Diffstat (limited to 'main.c')
| -rw-r--r-- | main.c | 20 |
1 files changed, 18 insertions, 2 deletions
@@ -25,18 +25,34 @@ #include <stdio.h> #include <stdlib.h> #include <unistd.h> +#include <string.h> #include "nimisewi.h" int -main(void) +main(int argc, char *argv[]) { #ifdef HAVE_PLEDGE if (pledge("stdio", NULL) == -1) { err(EXIT_FAILURE, "pledge"); } #endif - + if (argc == 2) { + if (!strcmp(argv[1], "--version") || !strcmp(argv[1], "-v")) { + printf("%s\n", PACKAGE_STRING); + printf("%s\n", PACKAGE_DESCRIPTION); +#if defined(HAVE_PLEDGE) || defined(HAVE_STRLCAT) + printf("features:\n"); +#endif +#ifdef HAVE_PLEDGE + printf("HAVE_PLEDGE\n"); +#endif +#ifdef HAVE_STRLCAT + printf("HAVE_STRLCAT\n"); +#endif + return EXIT_SUCCESS; + } + } char *ns; ns = nimi_sewi(); if (ns == NULL) { |
