pw_watch: Rework arguments
- Update the command line arguments to make pw watch simpler to use.
Positional arguments are interpreted as targets in the default output
directory. -C or --build_directory can be provided to support
specifying the build directory or using multiple directories.
- Find Ninja directories by build.ninja instead of args.gn to support
CMake.
- Call .kill() instead of .terminate() on Ninja to give it time to
properly clean up before closing.
- Import Path from pathlib, for consistency with other modules.
Change-Id: Ic66e58ce775de4a3a8749109d4ff65eb78a22aac
Reviewed-on: https://pigweed-review.googlesource.com/c/pigweed/pigweed/+/25760
Reviewed-by: Keir Mierle <keir@google.com>
Commit-Queue: Wyatt Hepler <hepler@google.com>
diff --git a/pw_build/docs.rst b/pw_build/docs.rst
index d1c5b46..cd78693 100644
--- a/pw_build/docs.rst
+++ b/pw_build/docs.rst
@@ -391,7 +391,7 @@
.. code-block:: sh
- pw watch out/cmake_host pw_run_tests.modules
+ pw watch -C out/cmake_host pw_run_tests.modules
CMake functions
---------------