summary |
shortlog |
log |
commit | commitdiff |
tree
raw |
patch |
inline | side by side (from parent 1:
42b31d8)
Support -h option for printing help text.
#include <sys/un.h>
#include <unistd.h>
#include <sys/un.h>
#include <unistd.h>
#include "charfuncs.h"
#include "cleanup.h"
#include "keyd.h"
#include "charfuncs.h"
#include "cleanup.h"
#include "keyd.h"
+static void usage(void)
+{
+ puts("keyd " PACKAGE_VERSION " - backend key serving daemon for the "
+ "onak PGP keyserver.\n");
+ puts("Usage:\n");
+ puts("\tkeyd [options]\n");
+ puts("\tOptions:\n:");
+ puts("-c <file> - use <file> as the config file");
+ puts("-f - run in the foreground");
+ puts("-h - show this help text");
+ exit(EXIT_FAILURE);
+}
+
int main(int argc, char *argv[])
{
int fd = -1;
int main(int argc, char *argv[])
{
int fd = -1;
bool foreground = false;
int optchar;
bool foreground = false;
int optchar;
- while ((optchar = getopt(argc, argv, "c:f")) != -1 ) {
+ while ((optchar = getopt(argc, argv, "c:fh")) != -1 ) {
switch (optchar) {
case 'c':
configfile = strdup(optarg);
switch (optchar) {
case 'c':
configfile = strdup(optarg);
case 'f':
foreground = true;
break;
case 'f':
foreground = true;
break;
+ case 'h':
+ default:
+ usage();
+ break;