[llvm] f4d5b14 - [gn] Give two scripts argparse.RawDescriptionHelpFormatter

Nico Weber via llvm-commits llvm-commits at lists.llvm.org
Fri Aug 9 08:10:23 PDT 2024


Author: Nico Weber
Date: 2024-08-09T11:10:12-04:00
New Revision: f4d5b14dcc65578db1688580a71db0783bfc82f9

URL: https://github.com/llvm/llvm-project/commit/f4d5b14dcc65578db1688580a71db0783bfc82f9
DIFF: https://github.com/llvm/llvm-project/commit/f4d5b14dcc65578db1688580a71db0783bfc82f9.diff

LOG: [gn] Give two scripts argparse.RawDescriptionHelpFormatter

Without this, the doc string is put in a single line. These
scripts have multi-line docstrings, so this makes their --help
output look much nicer.

Otherwise, no behavior change.

Added: 
    

Modified: 
    llvm/utils/gn/build/symbol_exports.py
    llvm/utils/gn/build/symlink_or_copy.py

Removed: 
    


################################################################################
diff  --git a/llvm/utils/gn/build/symbol_exports.py b/llvm/utils/gn/build/symbol_exports.py
index 379a999d4c7781..708e2edd889b49 100755
--- a/llvm/utils/gn/build/symbol_exports.py
+++ b/llvm/utils/gn/build/symbol_exports.py
@@ -15,7 +15,9 @@
 
 
 def main():
-    parser = argparse.ArgumentParser(description=__doc__)
+    parser = argparse.ArgumentParser(
+        description=__doc__,
+        formatter_class=argparse.RawDescriptionHelpFormatter)
     parser.add_argument("--format", required=True, choices=("linux", "mac", "win"))
     parser.add_argument("source")
     parser.add_argument("output")

diff  --git a/llvm/utils/gn/build/symlink_or_copy.py b/llvm/utils/gn/build/symlink_or_copy.py
index cbc559a6778f93..d586b8904a41b6 100755
--- a/llvm/utils/gn/build/symlink_or_copy.py
+++ b/llvm/utils/gn/build/symlink_or_copy.py
@@ -12,7 +12,9 @@
 
 
 def main():
-    parser = argparse.ArgumentParser(description=__doc__)
+    parser = argparse.ArgumentParser(
+        description=__doc__,
+        formatter_class=argparse.RawDescriptionHelpFormatter)
     parser.add_argument(
         "--stamp", required=True, help="name of a file whose mtime is updated on run"
     )


        


More information about the llvm-commits mailing list