MCPcopy Create free account
hub / github.com/apitrace/apitrace / command

Function command

cli/cli_trace.cpp:377–457  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

375};
376
377static int
378command(int argc, char *argv[])
379{
380 int verbose = 0;
381 trace::API api =
382#if defined(__linux__) && !defined(HAVE_X11)
383 trace::API_EGL
384#else
385 trace::API_GL
386#endif
387 ;
388 const char *output = NULL;
389 bool debug = false;
390 bool mhook = false;
391 bool timestamp = false;
392
393 int opt;
394 while ((opt = getopt_long(argc, argv, shortOptions, longOptions, NULL)) != -1) {
395 switch (opt) {
396 case 'h':
397 usage();
398 return 0;
399 case 'v':
400 ++verbose;
401 break;
402 case 'a':
403 if (strcmp(optarg, "gl") == 0) {
404 api = trace::API_GL;
405 } else if (strcmp(optarg, "egl") == 0) {
406 api = trace::API_EGL;
407 } else if (strcmp(optarg, "ddraw") == 0 ||
408 strcmp(optarg, "d3d6") == 0 ||
409 strcmp(optarg, "d3d7") == 0) {
410 api = trace::API_D3D7;
411 } else if (strcmp(optarg, "d3d8") == 0) {
412 api = trace::API_D3D8;
413 } else if (strcmp(optarg, "d3d9") == 0) {
414 api = trace::API_D3D9;
415 } else if (strcmp(optarg, "dxgi") == 0 ||
416 strcmp(optarg, "d3d10") == 0 ||
417 strcmp(optarg, "d3d10_1") == 0 ||
418 strcmp(optarg, "d3d11") == 0 ||
419 strcmp(optarg, "d3d11_1") == 0) {
420 api = trace::API_DXGI;
421 } else if (strcmp(optarg, "d2d") == 0 ||
422 strcmp(optarg, "d2d1") == 0) {
423 api = trace::API_D2D1;
424 } else {
425 std::cerr << "error: unknown API `" << optarg << "`\n";
426 usage();
427 return 1;
428 }
429 break;
430 case 'o':
431 output = optarg;
432 break;
433 case 'd':
434 debug = true;

Callers

nothing calls this directly

Calls 2

traceProgramFunction · 0.85
usageFunction · 0.70

Tested by

no test coverage detected