--- lbbs/src/main.c 2004/10/18 08:44:54 1.2 +++ lbbs/src/main.c 2005/03/17 10:48:46 1.9 @@ -1,5 +1,5 @@ /*************************************************************************** - bbsd.c - description + main.c - description ------------------- begin : Mon Oct 11 2004 copyright : (C) 2004 by Leaflet @@ -15,26 +15,132 @@ * * ***************************************************************************/ +#include "bbs.h" #include "common.h" +#include "io.h" +#include "menu.h" +#include -int -main (int argc, char *argv[]) +void +app_help(void) { - FILE *fp; - time_t t; + prints ( + "Usage: bbsd [-fhv] [...]\n\n" + "-f\t--foreground\t\tForce program run in foreground\n" + "-h\t--help\t\t\tDisplay this help message\n" + "-v\t--version\t\tDisplay version information\n" + "\t--display-log\t\tDisplay standard log information\n" + "\t--display-error-log\tDisplay error log information\n" + "\n If meet any bug, please report to \n\n" + ); +} - init_daemon (); +void +arg_error(void) +{ + prints ("Invalid arguments\n"); + app_help(); +} - while (1) +int +main (int argc, char *argv[]) +{ + char log_dir[256], file_log_std[256], file_log_error[256], file_config[256]; + int i,j; + int daemon = 1, std_log_redir = 0, error_log_redir = 0; + + //Parse args + for (i=1; i= 0) - { - t = time (0); - fprintf (fp, "I'm here at %s\n", asctime (localtime (&t))); - fclose (fp); - } + case '-': + if (argv[i][1] != '-') + { + for (j=1; j