MCPcopy Create free account
hub / github.com/acl-dev/acl / main

Function main

lib_acl_cpp/samples/scan_dir/main.cpp:177–250  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

175}
176
177int main(int argc, char* argv[])
178{
179 int ch;
180 bool recursive = false, fullpath = false, show_all = false, ignore = false;
181 acl::string dpath, spath, mode, types("c;cpp;cc;cxx;h;hpp;hxx");
182 acl::log::stdout_open(true);
183
184 while ((ch = getopt(argc, argv, "hs:d:t:rae:AI")) > 0) {
185 switch (ch) {
186 case 'h':
187 usage(argv[0]);
188 return 0;
189 case 's':
190 spath = optarg;
191 break;
192 case 'd':
193 dpath = optarg;
194 break;
195 case 't':
196 mode = optarg;
197 break;
198 case 'r':
199 recursive = true;
200 break;
201 case 'a':
202 fullpath = true;
203 break;
204 case 'e':
205 types = optarg;
206 break;
207 case 'A':
208 show_all = true;
209 break;
210 case 'I':
211 ignore = true;
212 break;
213 default:
214 break;
215 }
216 }
217
218 if (spath.empty()) {
219 usage(argv[0]);
220 return 1;
221 }
222
223 if (!spath.end_with("/"))
224 spath += "/";
225
226 acl::scan_dir scan;
227
228 if (mode == "dir")
229 ls_dir(scan, spath, recursive, fullpath);
230 else if (mode == "file")
231 ls_file(scan, spath, recursive, fullpath);
232 else if (mode == "diff") {
233 if (dpath.empty()) {
234 usage(argv[0]);

Callers

nothing calls this directly

Calls 8

ls_dirFunction · 0.85
ls_fileFunction · 0.85
diff_pathFunction · 0.85
ls_allFunction · 0.85
end_withMethod · 0.80
usageFunction · 0.70
getoptFunction · 0.50
emptyMethod · 0.45

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…