Exemplo n.º 1
0
  int Main() {
    ScopeExit at_exit(Logger::ExitLogger);
    try {
      Add(std::make_unique<FilesCommand>());
      Add(std::make_unique<MessagesCommand>());
      Add(std::make_unique<NetCommand>());
      Add(std::make_unique<FixCommand>());
      Add(std::make_unique<wwiv::wwivutil::fido::FidoCommand>());

      if (!cmdline_.Parse()) { return 1; }
      const std::string bbsdir(cmdline_.arg("bbsdir").as_string());
      Config config(bbsdir);
      if (!config.IsInitialized()) {
        LOG(ERROR) << "Unable to load CONFIG.DAT.";
        return 1;
      }
      command_config_.reset(new Configuration(bbsdir, &config));
      if (!command_config_->initialized()) {
        LOG(ERROR) << "Unable to load NETWORKS.";
        return 1;
      }
      SetConfigs();
      return cmdline_.Execute();
    } catch (const std::exception& e) {
      LOG(ERROR) << e.what();
    }
    return 1;
  }
Exemplo n.º 2
0
void CCCBot :: ReloadConfigs( )
{
	CConfig CFG;
	CFG.Read( CFGFile );
	SetConfigs( &CFG );
}