Skip to content
option.hh 1.12 KiB
Newer Older
Seblu's avatar
Seblu committed
/*
  This file is part of SLS.
Seblu's avatar
Seblu committed
  Copyright (C) 2008 Sebastien LUTTRINGER <contact@seblu.net>
Seblu's avatar
Seblu committed

  SLS is free software; you can redistribute it and/or modify
  it under the terms of the GNU General Public License as published by
Seblu's avatar
Seblu committed
  the Free Software Foundation; version 2 of the License.
Seblu's avatar
Seblu committed

  SLS is distributed in the hope that it will be useful,
  but WITHOUT ANY WARRANTY; without even the implied warranty of
  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
  GNU General Public License for more details.

  You should have received a copy of the GNU General Public License
  along with SLS; if not, write to the Free Software
Seblu's avatar
Seblu committed
  Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA  02110-1301  USA
Seblu's avatar
Seblu committed
*/

Seblu's avatar
Seblu committed
#ifndef OPTIONS_HH
# define OPTIONS_HH

struct Option {
  Option();

  Option &load(int argc, char *argv[]);
  Option &loadenv();

  void usage(const char *name, ostream &out) const;

  friend ostream &operator<<(ostream &, const Option &);

  bool verbose;
Seblu's avatar
Seblu committed
  string database;
Seblu's avatar
Seblu committed

  // socket option
  int port;
Seblu's avatar
Seblu committed
  size_t maxthread;
Seblu's avatar
Seblu committed

  // daemon options
  bool daemon;
  bool closefd;
  string pidfile;
  string logfile;

};

#endif