6cdb9a2a9c
Signed-off-by: Ian Moffett <ian@mirocom.org>
48 lines
781 B
C
48 lines
781 B
C
/*
|
|
* Copyright (c) 2026, Chloe Moffett
|
|
* Provided under the BSD-3 clause
|
|
*/
|
|
|
|
#include <stdio.h>
|
|
#include <unistd.h>
|
|
#include "endpoint/common.h"
|
|
|
|
static void
|
|
help(void)
|
|
{
|
|
printf("usage: ./remailsv <flags>\n");
|
|
printf("... [-h] Display this help menu\n");
|
|
printf("... [-v] Display the version\n");
|
|
}
|
|
|
|
static void
|
|
version(void)
|
|
{
|
|
printf("Version v%s\n", SERVER_VERSION);
|
|
}
|
|
|
|
int
|
|
main(int argc, char **argv)
|
|
{
|
|
int opt;
|
|
|
|
if (argc < 2) {
|
|
printf("fatal: too few arguments!\n");
|
|
help();
|
|
return -1;
|
|
}
|
|
|
|
while ((opt = getopt(argc, argv, "hv")) != -1) {
|
|
switch (opt) {
|
|
case 'h':
|
|
help();
|
|
return -1;
|
|
case 'v':
|
|
version();
|
|
return 0;
|
|
}
|
|
}
|
|
|
|
return 0;
|
|
}
|