Compare commits

...

4 Commits

Author SHA1 Message Date
Omar Polo dd3f04b227 titan: accept either one or two positional arguments 2024-01-08 08:39:18 +00:00
Omar Polo fd48b7c0c4 titan: usage and exit on unknown flags 2024-01-08 08:38:47 +00:00
Omar Polo ac46710a4b fix ge^W gemexp version string 2024-01-08 08:34:36 +00:00
Omar Polo 104a2059e6 make `serve-gemini' use gemexp (from repo) instead of gmid
the standalone / config-less mode was removed from gmid and put
into gemexp time ago...
2024-01-08 08:32:19 +00:00
4 changed files with 7 additions and 5 deletions

4
ge.c
View File

@ -249,7 +249,7 @@ static __dead void
usage(void)
{
fprintf(stderr,
"Version: " GE_STRING "\n"
"Version: " GEMEXP_STRING "\n"
"Usage: %s [-hRV] [-d certs-dir] [-H hostname] [-p port] [dir]\n",
getprogname());
exit(1);
@ -295,7 +295,7 @@ main(int argc, char **argv)
gen_eckey = 0;
break;
case 'V':
puts("Version: " GE_STRING);
puts("Version: " GEMEXP_STRING);
return 0;
default:
usage();

2
gmid.h
View File

@ -53,7 +53,7 @@
#include "iri.h"
#define VERSION_STR(n) n " " VERSION
#define GE_STRING VERSION_STR("ge")
#define GEMEXP_STRING VERSION_STR("gemexp")
#define GG_STRING VERSION_STR("gg")
#define GMID_STRING VERSION_STR("gmid")

View File

@ -62,7 +62,7 @@ serve-www:
python3 -m http.server --directory www 8888
serve-gemini:
gmid -p 1966 ./gemini
./../gemexp ./gemini
upload:
openrsync --rsync-path=openrsync --del -a www/ antartica:/var/www/gmid.omarpolo.com

View File

@ -257,6 +257,8 @@ main(int argc, char **argv)
case 't':
token = optarg;
break;
default:
usage();
}
}
argc -= optind;
@ -267,7 +269,7 @@ main(int argc, char **argv)
if (cert != NULL && key == NULL)
key = cert;
if (argc > 2)
if (argc != 1 && argc != 2)
usage();
in = open_input_file(argc, argv);