pw_watch CLI reference#

pw_watch: Embedded development file system watcher

usage: pw watch [-h] [-C directory [target ...]]
                [--build-system-command directory command]
                [--run-command RUN_COMMAND] [-S SOURCE_PATH]
                [--default-build-system {ninja,bazel}] [-j JOBS] [-k]
                [--parallel] [--parallel-workers PARALLEL_WORKERS]
                [--logfile LOGFILE] [--separate-logfiles] [--debug-logging]
                [--banners | --no-banners] [--colors | --no-colors]
                [--patterns PATTERNS]
                [--ignore-patterns IGNORE_PATTERNS_STRING]
                [--exclude-list EXCLUDE_LIST [EXCLUDE_LIST ...]]
                [--restart | --no-restart] [--serve-docs]
                [--serve-docs-port SERVE_DOCS_PORT]
                [--serve-docs-path SERVE_DOCS_PATH] [-f]
                [target ...]

Build Directory and Command Options#

-C, --build-directory

Specify a build directory and optionally targets to build. pw watch -C out target1 target2 is equivalent to ‘ninja -C out taret1 target2’. The ‘out’ directory will be used if no others are provided.

Default: []

target

Default build targets. For example if the build directory is ‘out’ then, ‘ninja -C out taret1 target2’ will be run. To specify one or more directories, use the -C / --build-directory option.

Default: []

--build-system-command

Build system command for . Default: ninja

Default: []

--run-command

Additional commands to run. These are run before any -C arguments and may be repeated. For example: –run-command ‘bazel build //pw_cli/…’ –run-command ‘bazel test //pw_cli/…’ -C out python.lint python.test

Default: []

-S, --source-path

Path to the root of the source files. Defaults to thecurrent working directory. If running under bazel thiswill be set to the $BUILD_WORKSPACE_DIRECTORYenvironment variable.

--default-build-system

Possible choices: ninja, bazel

Build system to use when no build directories or build targets are specified on the command line.

Build Execution Options#

-j, --jobs

Specify the number of cores to use for each build system. This is passed to ninja, bazel and make as “-j”

-k, --keep-going

Keep building past the first failure. This is equivalent to running “ninja -k 0” or “bazel build -k”.

--parallel

Run all builds in parallel.

--parallel-workers

How many builds may run at the same time when –parallel is enabled. Default: 0 meaning run all in parallel.

Default: 0

Log File Options#

--logfile

Global build output log file.

--separate-logfiles

Create separate log files per build directory.

--debug-logging

Enable Python build execution tool debug logging.

Display Output Options#

--banners, --no-banners

Show pass/fail banners. (default: True)

Default: True

--colors, --no-colors

Force color output from ninja. (default: True)

Default: True

Watch Options#

--patterns

Comma delimited list of globs to watch to trigger recompile.

Default: “.bazel,.bzl,*.bloaty,*.c,*.cc,*.css,*.cpp,*.cmake,CMakeLists.txt,*.dts,*.dtsi,*.emb,*.gn,*.gni,*.go,*.h,*.hpp,*.html,*.js,*.ld,*.md,*.options,*.proto,*.py,*.rs,*.rst,*.s,*.S,*.toml,*.ts”

--ignore-patterns

Comma delimited list of globs to ignore events from.

--exclude-list

Directories to ignore during pw watch. This option may be repeated. Directories are passed as separate arguments.

Default: []

--restart, --no-restart

Whether to restart ongoing builds if files change. (default: True)

Default: True

--serve-docs

Start a webserver for docs on localhost. The port for this webserver can be set with the –serve-docs-port option. Defaults to http://127.0.0.1:8000

--serve-docs-port

Set the port for the docs webserver. Default: 8000.

Default: 8000

--serve-docs-path

Set the path for the docs to serve. Default: docs/gen/docs in the build directory.

Default: docs/gen/docs

-f, --fullscreen

Use a fullscreen interface.