Clarify docs on GN rebase_path.
A question came up in a code review, so this adds more explicit documentation
and hints for paths ending (or not) in slashes.
Review URL: https://codereview.chromium.org/1563543002
Cr-Original-Commit-Position: refs/heads/master@{#367623}
Cr-Mirrored-From: https://chromium.googlesource.com/chromium/src
Cr-Mirrored-Commit: e3b32676059d25162cd07201bbd33dfec3c60daf
diff --git a/tools/gn/function_rebase_path.cc b/tools/gn/function_rebase_path.cc
index 6661d81..ef5ef40 100644
--- a/tools/gn/function_rebase_path.cc
+++ b/tools/gn/function_rebase_path.cc
@@ -144,7 +144,7 @@
" relative to the source root, so can't also generate source-absolute\n"
" paths without more special-cases.\n"
"\n"
- "Arguments:\n"
+ "Arguments\n"
"\n"
" input\n"
" A string or list of strings representing file or directory names\n"
@@ -175,6 +175,12 @@
" names will be converted to be relative to the requested output\n"
" System-absolute paths will be unchanged.\n"
"\n"
+ " Whether an output path will end in a slash will match whether the\n"
+ " corresponding input path ends in a slash. It will return \".\" or\n"
+ " \"./\" (depending on whether the input ends in a slash) to avoid\n"
+ " returning empty strings. This means if you want a root path\n"
+ " (\"//\" or \"/\") not ending in a slash, you can add a dot (\"//.\").\n"
+ "\n"
"Example\n"
"\n"
" # Convert a file in the current directory to be relative to the build\n"