23
23
*/
24
24
25
25
#include < cstring>
26
+ #include < filesystem>
26
27
#include < fstream>
27
28
#include < iostream>
28
- #include < filesystem>
29
29
30
30
#include " loot/api.h"
31
31
#include " version.h"
@@ -42,30 +42,54 @@ fs::path mockGameInstall() {
42
42
return dataPath.parent_path ();
43
43
}
44
44
45
- int main (int argc, char ** argv) {
45
+ int main (int argc, char ** argv) {
46
46
using loot::LootVersion;
47
47
using loot::validator::Version;
48
48
using std::cout;
49
49
using std::endl;
50
50
51
- // Print help text if -h, --help or invalid args are given (including no args).
52
- if (argc < 2 || argc > 3 || (strcmp (argv[1 ], " -h" ) == 0 ) || (strcmp (argv[1 ], " --help" ) == 0 )) {
51
+ // Print help text if -h, --help or invalid args are given (including no
52
+ // args).
53
+ if (argc < 2 || argc > 3 || (strcmp (argv[1 ], " -h" ) == 0 ) ||
54
+ (strcmp (argv[1 ], " --help" ) == 0 )) {
53
55
cout << endl
54
- << " Usage: metadata-validator <metadata file path> [<prelude file path>]" << endl << endl
55
- << " Arguments:" << endl << endl
56
- << " " << " <metadata file path>" << " " << " The metadata file to validate." << endl
57
- << " " << " <prelude file path>" << " " << " The prelude metadata file to substitute in before validation (optional)." << endl
58
- << " " << " -v, --version" << " " << " Prints version information for this utility." << endl
59
- << " " << " -h, --help" << " " << " Prints this help text." << endl << endl;
56
+ << " Usage: metadata-validator <metadata file path> [<prelude file "
57
+ " path>]"
58
+ << endl
59
+ << endl
60
+ << " Arguments:" << endl
61
+ << endl
62
+ << " "
63
+ << " <metadata file path>"
64
+ << " "
65
+ << " The metadata file to validate." << endl
66
+ << " "
67
+ << " <prelude file path>"
68
+ << " "
69
+ << " The prelude metadata file to substitute in before validation "
70
+ " (optional)."
71
+ << endl
72
+ << " "
73
+ << " -v, --version"
74
+ << " "
75
+ << " Prints version information for this utility." << endl
76
+ << " "
77
+ << " -h, --help"
78
+ << " "
79
+ << " Prints this help text." << endl
80
+ << endl;
60
81
return 1 ;
61
82
}
62
83
63
84
// Print version info if -v or --version are given.
64
85
if ((strcmp (argv[1 ], " -v" ) == 0 ) || (strcmp (argv[1 ], " --version" ) == 0 )) {
65
- cout << endl << " LOOT Metadata Validator" << endl
66
- << " v" << Version::string () << " , build revision " << Version::revision << endl
67
- << " Using libloot v" << LootVersion::GetVersionString () << " , build revision " << LootVersion::revision
68
- << endl << endl;
86
+ cout << endl
87
+ << " LOOT Metadata Validator" << endl
88
+ << " v" << Version::string () << " , build revision " << Version::revision
89
+ << endl
90
+ << " Using libloot v" << LootVersion::GetVersionString ()
91
+ << " , build revision " << LootVersion::revision << endl
92
+ << endl;
69
93
return 0 ;
70
94
}
71
95
@@ -79,7 +103,8 @@ int main(int argc, char **argv) {
79
103
cout << endl;
80
104
81
105
// Create a handle for any game at any path, it doesn't matter.
82
- auto handle = loot::CreateGameHandle (loot::GameType::tes4, gamePath.string (), gamePath.string ());
106
+ auto handle = loot::CreateGameHandle (
107
+ loot::GameType::tes4, gamePath.string (), gamePath.string ());
83
108
84
109
if (argc == 2 ) {
85
110
handle->GetDatabase ()->LoadLists (argv[1 ]);
0 commit comments