-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathargs.h
More file actions
51 lines (36 loc) · 900 Bytes
/
args.h
File metadata and controls
51 lines (36 loc) · 900 Bytes
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
41
42
43
44
45
46
47
48
49
50
51
//
// Created by amoncusir on 04/10/23.
//
#ifndef LOGTRIGGER_SRC_ARGS_H
#define LOGTRIGGER_SRC_ARGS_H
#include <string>
#include <string_view>
#include <vector>
namespace Logtrigger
{
class Args
{
public:
struct TriggerArgs
{
const char* type {};
const char* matcher {};
const char* script_path {};
long cold_down = -1;
};
private:
const char* m_name {};
const char* m_sock_path {};
std::vector<TriggerArgs*> m_triggers {};
public:
Args(int argc, char** argv);
~Args();
const char* sock_path();
const std::vector<TriggerArgs*>& triggers();
bool is_valid();
void usage();
private:
static TriggerArgs* make_struct(const char* type, const char* value, const char* path);
};
}
#endif //LOGTRIGGER_SRC_ARGS_H