| 175 | } |
| 176 | |
| 177 | int 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]); |
nothing calls this directly
no test coverage detected
searching dependent graphs…