[clang] 900bb31 - [clang-format][NFC] Use `prog` in clang-format-diff.py (#74399)

via cfe-commits cfe-commits at lists.llvm.org
Tue Dec 5 02:36:18 PST 2023


Author: Owen Pan
Date: 2023-12-05T10:36:14Z
New Revision: 900bb318b5b8c485e57cf810253a656b0fb683bc

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

LOG: [clang-format][NFC] Use `prog` in clang-format-diff.py (#74399)

This is a minor improvement to #73491.

Added: 
    

Modified: 
    clang/tools/clang-format/clang-format-diff.py

Removed: 
    


################################################################################
diff  --git a/clang/tools/clang-format/clang-format-
diff .py b/clang/tools/clang-format/clang-format-
diff .py
index b25ee8f433751..0a2c24743678d 100755
--- a/clang/tools/clang-format/clang-format-
diff .py
+++ b/clang/tools/clang-format/clang-format-
diff .py
@@ -25,7 +25,6 @@
 
 import argparse
 import 
diff lib
-import os
 import re
 import subprocess
 import sys
@@ -37,9 +36,8 @@
 
 
 def main():
-    basename = os.path.basename(sys.argv[0])
     parser = argparse.ArgumentParser(
-        description=__doc__.format(clang_format_
diff =basename),
+        description=__doc__.format(clang_format_
diff ="%(prog)s"),
         formatter_class=argparse.RawDescriptionHelpFormatter,
     )
     parser.add_argument(


        


More information about the cfe-commits mailing list