/*******************************************************************\

Module:

Author: Daniel Kroening, kroening@cs.cmu.edu

\*******************************************************************/

#ifndef CPROVER_CMDLINE_H
#define CPROVER_CMDLINE_H

#include <vector>
#include <list>
#include <string>

class cmdlinet
{
public:
  bool parse(int argc, const char **argv, const char *optstring);
  const char *getval(char option) const;
  const char *getval(const char *option) const;
  const std::list<std::string> &get_values(const char *option) const;
  const std::list<std::string> &get_values(char option) const;
  bool isset(char option) const;
  bool isset(const char *option) const;

  void clear();

  typedef std::vector<std::string> argst;
  argst args;
  
  cmdlinet();
  ~cmdlinet();
  
protected:
  struct optiont
  {
    bool isset, hasval, islong;
    char optchar;
    std::string optstring;
    std::list<std::string> values;
  };
   
  std::vector<optiont> options;

  int getoptnr(char option) const;
  int getoptnr(const char *option) const;
};

#endif
