summaryrefslogtreecommitdiff
path: root/setup.cpp
blob: ab518dc8536bd4931c19a8a0e02f7398c7766d03 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
#include <getopt.h>
#include "setup.h"

namespace vdrlive {

Setup::Setup()
{
}

bool Setup::Parse( int argc, char* argv[] )
{
	static struct option opts[] = {
			{ "lib", required_argument, NULL, 'L' },
			{ 0 }
	};

	int optchar, optind = 0;
	while ( ( optchar = getopt_long( argc, argv, "L:", opts, &optind ) ) != -1 ) {
		switch ( optchar ) {
		case 'L': m_libraryPath = optarg; break;
		default:  return false;
		}
	}
	return true;
}

Setup& Setup::Get()
{
	static Setup instance;
	return instance;
}
	
} // namespace vdrlive