From 018e6ca07abe5b8ff52e949ee44c7e75ad12a70b Mon Sep 17 00:00:00 2001 From: Janos SUTO Date: Thu, 30 Nov 2017 10:32:14 +0100 Subject: [PATCH] src: added proper usage text to piler daemons Signed-off-by: Janos SUTO --- src/piler-smtp.c | 13 ++++++++++++- src/piler.c | 13 ++++++++++++- 2 files changed, 24 insertions(+), 2 deletions(-) diff --git a/src/piler-smtp.c b/src/piler-smtp.c index 7d8f7b35..a6926c6f 100644 --- a/src/piler-smtp.c +++ b/src/piler-smtp.c @@ -41,6 +41,17 @@ struct passwd *pwd; struct smtp_session *session, **sessions=NULL; +void usage(){ + printf("\nusage: piler\n\n"); + printf(" -c Config file to use if not the default\n"); + printf(" -d Fork to the background\n"); + printf(" -v Return the version and build number\n"); + printf(" -V Return the version and some build parameters\n"); + + exit(0); +} + + void p_clean_exit(){ int i; @@ -143,7 +154,7 @@ int main(int argc, char **argv){ case 'h' : default : - __fatal("usage: ..."); + usage(); } } diff --git a/src/piler.c b/src/piler.c index 17382746..617c6053 100644 --- a/src/piler.c +++ b/src/piler.c @@ -41,6 +41,17 @@ struct passwd *pwd; struct child children[MAXCHILDREN]; +void usage(){ + printf("\nusage: piler\n\n"); + printf(" -c Config file to use if not the default\n"); + printf(" -d Fork to the background\n"); + printf(" -v Return the version and build number\n"); + printf(" -V Return the version and some build parameters\n"); + + exit(0); +} + + void takesig(int sig){ int i, status; pid_t pid; @@ -474,7 +485,7 @@ int main(int argc, char **argv){ case 'h' : default : - __fatal("usage: ..."); + usage(); } }