File: options.cpp

package info (click to toggle)
dmrgpp 6.06-2
  • links: PTS, VCS
  • area: main
  • in suites: sid, trixie
  • size: 113,900 kB
  • sloc: cpp: 80,986; perl: 14,772; ansic: 2,923; makefile: 83; sh: 17
file content (20 lines) | stat: -rw-r--r-- 636 bytes parent folder | download
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
#include "Options.h"
#include <iostream>

int main(int argc, char* argv[])
{
	if (argc < 2) {
		std::cerr << "USAGE is " << argv[0] << " comma,separated,list,of,options\n";
		return 1;
	}
	PsimagLite::Vector<PsimagLite::String>::Type registerOpts;
	registerOpts.push_back("fast");
	registerOpts.push_back("verbose");
	registerOpts.push_back("hasthreads");
	PsimagLite::Options::Writeable optWriteable(
	    registerOpts, PsimagLite::Options::Writeable::STRICT);

	PsimagLite::String myoptions(argv[1]);
	PsimagLite::Options::Readable optsReadable(optWriteable, myoptions);
	std::cout << "fast=" << optsReadable.isSet("fast") << "\n";
}