@@ -38,7 +38,6 @@ struct CheckOptions {
38
38
std::string delimiter = " ," ;
39
39
40
40
// Flags:
41
- bool distinct = false ;
42
41
bool summarize = false ;
43
42
bool output_json = false ;
44
43
int json_indent = 2 ;
@@ -129,49 +128,8 @@ inline int check_merged(const CheckOptions& opt, const std::vector<std::string>&
129
128
return ok ? EXIT_SUCCESS : EXIT_FAILURE;
130
129
}
131
130
132
- inline int check_distinct (const CheckOptions& opt, const std::vector<std::string>& filepaths) {
133
- int exit_code = EXIT_SUCCESS;
134
- auto check_each = [&](std::function<void (const std::string&, bool *)> func) {
135
- for (const auto & x : filepaths) {
136
- bool ok = true ;
137
- func (x, &ok);
138
- if (!ok) {
139
- exit_code = EXIT_FAILURE;
140
- }
141
- }
142
- };
143
-
144
- if (opt.output_json ) {
145
- // Output for each file a summary
146
- cloe::Json output;
147
- check_each ([&](const auto & f, bool * ok) {
148
- output[f] = check_json (opt, std::vector<std::string>{f}, ok);
149
- });
150
- opt.output << output.dump (opt.json_indent ) << std::endl;
151
- } else if (opt.summarize ) {
152
- check_each ([&](const auto & f, bool * ok) {
153
- opt.output << f << " : " << check_summary (opt, std::vector<std::string>{f}, ok) << std::endl;
154
- });
155
- } else {
156
- check_each ([&](const auto & f, bool * ok) {
157
- try {
158
- check_stack (opt.stack_options , std::vector<std::string>{f}, ok);
159
- } catch (cloe::ConcludedError&) {
160
- } catch (std::exception & e) {
161
- opt.output << f << " : " << e.what () << std::endl;
162
- }
163
- });
164
- }
165
-
166
- return exit_code;
167
- }
168
-
169
131
inline int check (const CheckOptions& opt, const std::vector<std::string>& filepaths) {
170
- if (opt.distinct ) {
171
- return check_distinct (opt, filepaths);
172
- } else {
173
- return check_merged (opt, filepaths);
174
- }
132
+ return check_merged (opt, filepaths);
175
133
}
176
134
177
135
} // namespace engine
0 commit comments