startgit

Static page generator for git repositories
git clone git://git.dimitrijedobrota.com/startgit.git
Log | Files | Refs | README | LICENSE | HACKING | CONTRIBUTING | CODE_OF_CONDUCT | BUILDING

arguments.hpp (1342B)


0 #pragma once
2 #include <filesystem>
3 #include <string>
4 #include <string_view>
5 #include <unordered_set>
6 #include <vector>
8 namespace startgit
9 {
11 struct arguments_t
12 {
13 void add_special(std::string_view value) { special.insert(value); }
15 void set_repository(std::string_view value)
16 {
17 repos.emplace_back(std::filesystem::canonical(value));
18 }
20 void set_resource(std::string_view value)
21 {
22 resource_url = value;
23 if (resource_url.back() == '/') {
24 resource_url.pop_back();
25 }
26 }
28 void set_base(std::string_view value)
29 {
30 base_url = value;
31 if (base_url.back() == '/') {
32 base_url.pop_back();
33 }
34 }
36 std::filesystem::path output_dir = ".";
37 std::vector<std::filesystem::path> repos;
38 std::string resource_url = "https://dimitrijedobrota.com";
39 std::string base_url = "https://git.dimitrijedobrota.com";
40 std::string author = "Dimitrije Dobrota";
41 std::string title = "Collection of git repositories";
42 std::string description = "Publicly available personal projects";
43 std::string github = "DimitrijeDobrota";
44 std::unordered_set<std::filesystem::path> special = {
45 "BUILDING.md",
46 "CODE_OF_CONDUCT.md",
47 "CONTRIBUTING.md",
48 "HACKING.md",
49 "LICENSE.md",
50 "README.md",
51 };
52 bool force = false;
53 };
55 extern arguments_t args; // NOLINT
57 } // namespace startgit