Commit 08cd5fec authored by Arthur Milchior's avatar Arthur Milchior Committed by LUCI CQ

Clarify documentation from `gclient recurse`

Applying a command on a value usually mean to call `cmd value`. Hence
it seemed important to me to clarify that the current working
directory is changed.

Tested:
* Entered `gclient recurse --help` and checked the new message appear.
* Entered both examples in the terminal and checked the output.

Thanks to sdefresne for his help understanding recurse.

Change-Id: I729efc2014ed3cf90112cc89875a283d58ce8af0
Fixed: 1345272
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/tools/depot_tools/+/3769966Reviewed-by: 's avatarArthur Milchior <arthurmilchior@google.com>
Reviewed-by: 's avatarAravind Vasudevan <aravindvasudev@google.com>
Commit-Queue: Arthur Milchior <arthurmilchior@google.com>
parent 3e2f92a3
......@@ -2251,9 +2251,15 @@ class CipdDependency(Dependency):
def CMDrecurse(parser, args):
"""Operates [command args ...] on all the dependencies.
Runs a shell command on all entries.
Sets GCLIENT_DEP_PATH environment variable as the dep's relative location to
root directory of the checkout.
Change directory to each dependency's directory, and call [command
args ...] there. Sets GCLIENT_DEP_PATH environment variable as the
dep's relative location to root directory of the checkout.
Examples:
* `gclient recurse --no-progress -j1 sh -c 'echo "$GCLIENT_DEP_PATH"'`
print the relative path of each dependency.
* `gclient recurse --no-progress -j1 sh -c "pwd"`
print the absolute path of each dependency.
"""
# Stop parsing at the first non-arg so that these go through to the command
parser.disable_interspersed_args()
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment