/* $Id$ */

#include <unistd.h>
#include "throw.h"
#include "cli.h"

CCli::CCli(int ac, char * const av[])
{
	bool done(false);
	while (!done)
	{
		switch (getopt(ac, av, "p:f:c:"))
		{
			case 'p':
				m_port = optarg;
				break;

			case 'f':
				m_binfile = optarg;
				break;

			case 'c':
				m_csvfile = optarg;
				break;

			case -1:
				done = true;
				break;

			default:
				Throw("Syntax error");
		}
	}
}

const std::string &CCli::GetPort() const
{
	return m_port;
}

const std::string &CCli::GetBinfile() const
{
	return m_binfile;
}

const std::string &CCli::GetCsvfile() const
{
	return m_csvfile;
}
