summaryrefslogtreecommitdiffstats
path: root/Options.h
blob: 94409644f40d53c4c98d69001cd8e8639f03ff02 (plain) (blame)
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
34
35
36
37
38
39
40
#ifndef OPTIONS_H
#define OPTIONS_H

#include <iostream>
#include <string>
#include <sstream>
#include <fstream>
#include <vector>
#include <unistd.h>

#include "Cryptor.h"

#define OPTIONS_FILE ".compassoptions"

class Options {
public:
	Options();
	virtual ~Options();

	PasswordSpec getPasswordSpec();
	void checkString(std::string str);
	void parseArgv(int start, int argc, char* argv[]);

	// Options
	std::string user;
	std::string pass;
	std::string dr; // directory
	int cn; // credential number
	int ml; // max length
	bool ns; // no special chars
	bool nc; // no caps
	bool nn; // no numeric chars
	bool pp; // print password (don't use clipboard)
	bool cc; // preserve clipboard (don't clean)

private:
	std::vector<std::string> loadOptionsFile(int start, int argc, char* argv[]);
};

#endif // OPTIONS_H