26 #ifndef SETTINGS_H |
26 #ifndef SETTINGS_H |
27 #define SETTINGS_H |
27 #define SETTINGS_H |
28 |
28 |
29 #include <string> |
29 #include <string> |
30 #include <vector> |
30 #include <vector> |
|
31 #include <unordered_map> |
31 |
32 |
32 namespace fm { |
33 namespace fm { |
33 |
34 |
34 constexpr static short settings_current_year = 0; |
35 constexpr static short settings_current_year = 0; |
35 |
36 |
36 struct settings { |
37 struct settings { |
37 std::string hg{"/usr/bin/hg"}; |
38 std::string hg{"/usr/bin/hg"}; |
38 std::string git{"/usr/bin/git"}; |
39 std::string git{"/usr/bin/git"}; |
39 std::vector<std::string> paths; |
40 std::vector<std::string> paths; |
40 std::vector<std::string> authors; |
41 std::vector<std::string> authors; |
|
42 std::unordered_map<std::string, std::string> authormap; |
|
43 |
41 unsigned char depth = 1; |
44 unsigned char depth = 1; |
42 bool update_repos = true; |
45 bool update_repos = true; |
43 bool separate = false; |
46 bool separate = false; |
44 unsigned short year = settings_current_year; |
47 unsigned short year = settings_current_year; |
45 |
48 |
|
49 int parse_authormap(const std::string& path); |
46 [[nodiscard]] bool exclude_author(const std::string &author) const; |
50 [[nodiscard]] bool exclude_author(const std::string &author) const; |
|
51 |
|
52 std::string map_author(std::string_view author) const; |
47 }; |
53 }; |
48 |
54 |
49 } |
55 } |
50 |
56 |
51 #endif //SETTINGS_H |
57 #endif //SETTINGS_H |