Skip to content
Repos

DevPlaceApp

C++ 1.0 KB30 lines Opens in site

Directory Raw Download

#pragma once
// Spec: FR-CLI-01. Command line options.
#include <string>
#include <vector>

namespace dp {

struct CliOptions {
  std::string screen;       // --screen <id>
  std::string screenshot;   // --screenshot <png>
  std::string script;       // --script <file>
  std::string baseUrl;      // --base-url <url>
  bool mock = false;        // --mock
  bool asUser = false;      // --as-user (mock sign in before the screen)
  bool listScreens = false; // --list-screens
  bool dumpLabels = false;  // --dump-a11y
  int bench = 0;            // --bench N: time N frames after the screen settled
  float scale = 0;          // --scale <n>
  float width = 430, height = 900;  // --size WxH
  int fitScreen = 0;        // --fit-screen PERCENT: height cap plus centering (0 = off)
  int dark = -1;            // --dark 1, --light 0
  double wait = 3;          // --wait <seconds> (screenshot settle limit)
  bool help = false;
  std::string error;

  static CliOptions parse(int argc, char** argv);
  static std::string usage();
};

}  // namespace dp
39.6ms