| 41 | Flags flags; |
| 42 | |
| 43 | Flags::Flags() |
| 44 | { |
| 45 | // We log to stderr by default, but when running tests we'd prefer |
| 46 | // less junk to fly by, so force one to specify the verbosity. |
| 47 | add(&Flags::verbose, |
| 48 | "verbose", |
| 49 | "Log all severity levels to stderr", |
| 50 | false); |
| 51 | |
| 52 | add(&Flags::benchmark, |
| 53 | "benchmark", |
| 54 | "Run the benchmark tests (and skip other tests)", |
| 55 | false); |
| 56 | |
| 57 | // We determine the defaults for 'source_dir' and 'build_dir' from |
| 58 | // preprocessor definitions (at the time this comment was written |
| 59 | // these were set via '-DSOURCE_DIR=...' and '-DBUILD_DIR=...' in |
| 60 | // src/Makefile.am). |
| 61 | Result<string> path = os::realpath(SOURCE_DIR); |
| 62 | CHECK_SOME(path); |
| 63 | add(&Flags::source_dir, |
| 64 | "source_dir", |
| 65 | "Where to find the source directory", |
| 66 | path.get()); |
| 67 | |
| 68 | path = os::realpath(BUILD_DIR); |
| 69 | CHECK_SOME(path); |
| 70 | |
| 71 | add(&Flags::build_dir, |
| 72 | "build_dir", |
| 73 | "Where to find the build directory", |
| 74 | path.get()); |
| 75 | |
| 76 | add(&Flags::docker, |
| 77 | "docker", |
| 78 | "Where to find docker executable", |
| 79 | "docker"); |
| 80 | |
| 81 | add(&Flags::docker_socket, |
| 82 | "docker_socket", |
| 83 | "Resource used by the agent and the executor to provide CLI access\n" |
| 84 | "to the Docker daemon. On Unix, this is typically a path to a\n" |
| 85 | "socket, such as '/var/run/docker.sock'. On Windows this must be a\n" |
| 86 | "named pipe, such as '//./pipe/docker_engine'. NOTE: This must be\n" |
| 87 | "the path used by the Docker image used to run the agent.\n", |
| 88 | slave::DEFAULT_DOCKER_HOST_RESOURCE); |
| 89 | |
| 90 | // This help message for --modules flag is the same for |
| 91 | // {master,slave,sched,tests}/flags.[ch]pp and should always be kept in |
| 92 | // sync. |
| 93 | // TODO(karya): Remove the JSON example and add reference to the |
| 94 | // doc file explaining the --modules flag. |
| 95 | add(&Flags::modules, |
| 96 | "modules", |
| 97 | "List of modules to be loaded and be available to the internal\n" |
| 98 | "subsystems.\n" |
| 99 | "\n" |
| 100 | "Use --modules=filepath to specify the list of modules via a\n" |