-
Notifications
You must be signed in to change notification settings - Fork 46
/
Copy pathoptions-parser.h
61 lines (43 loc) · 1.48 KB
/
options-parser.h
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
52
53
54
55
56
57
58
59
#pragma once
#include <memory>
#include <stdlib.h>
#include <string>
#include <utility>
#include <vector>
/// @brief CLI arguments parser
class OptionsParser {
public:
/// @brief key/value type wrapper
using dualparam_t = std::pair<std::string, bool>;
/// @brief Arguments description struct
struct GenOptions
{
/// @brief dbc file name
dualparam_t dbc;
/// @brief output directory for generated files
dualparam_t outdir;
/// @brief main driver name
dualparam_t drvname;
/// @brief rewrite previously generated files or generate to next subdirectory
bool is_rewrite{false};
/// @brief add additional directory named as dbc driver inside generation output directory
bool is_driver_dir{false};
/// @brief add generation date at the beggining of the source file
bool add_gen_date{false};
/// @brief generate specific utility drivers for each ECU defined in the matrix
bool is_nodeutils{false};
/// @brief do not generate configuration file
bool is_noconfig{false};
/// @brief do not generate canmonitorutil header
bool is_nocanmon{false};
/// @brief do not generate fmon header
bool is_nofmon{false};
/// @brief help is requested
bool is_help{false};
};
/// @brief Parses arguments and theirs optional values
/// @param argc arguments number
/// @param argv pointer to array with arguments
/// @return parsed arguments in structured form
GenOptions GetOptions(int argc, char** argv);
};