Commit 3361d522 authored by Seblu's avatar Seblu
Browse files

Daemon prend le fichier /etc/sldrc par defaut

parent ea2c269a
Loading
Loading
Loading
Loading
+4 −7
Original line number Diff line number Diff line
@@ -21,7 +21,9 @@

SLDaemon *SLDaemon::instance_ = 0;

SLDaemon::SLDaemon() : socket_fs_(0) {}
SLDaemon::SLDaemon() : socket_fs_(0) {
  options_.conffile = "/etc/sldrc";
}

SLDaemon &SLDaemon::Instance() {
  if (instance_ == 0)
@@ -35,7 +37,7 @@ void SLDaemon::usage(const char *argv0) const {
	    << " [-f conffile] [-d scriptdir] [-h] [-v] [-l login]"
	    << "[-p pass] [-H host] [-P port] [-V]"
	    << std::endl
	    << "  -f conffile  : read and load conf file." << std::endl
	    << "  -f conffile  : read and load conf file (def: /etc/sldrc)." << std::endl
	    << "  -d scriptdir : Scripts directory." << std::endl
	    << "  -h           : Print this usage." << std::endl
	    << "  -v           : Verbose mode." << std::endl
@@ -49,11 +51,6 @@ void SLDaemon::usage(const char *argv0) const {
SLDaemon::Options *SLDaemon::getoptions(int argc, char *argv[]) const {
  Options opt, *mopt;

  if (argc == 1) {
    usage(*argv);
    throw Error(ERR_USAGE);
  }

  for (int i = 1; i < argc; ++i) {
    if (!strcmp(argv[i], "-h")) {
      usage(*argv);
+1 −1
Original line number Diff line number Diff line
@@ -34,7 +34,7 @@ enum {
// Gonstant
// -----------------------------------------------------------------------------

static const string VERSION = "2";
static const string VERSION = "1";
static const int MAX_LINE_SIZE = 512;
static const int MAX_CONF_LINE_SIZE = 2048;
static const string RCV_DATA = "<< ";