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

Owen Pan via cfe-commits cfe-commits at lists.llvm.org
Mon Dec 4 17:38:02 PST 2023


https://github.com/owenca created https://github.com/llvm/llvm-project/pull/74399

This is a minor improvement to #73491.

>From ee039e7c50751fabdbaadae73a0a09bc905620f2 Mon Sep 17 00:00:00 2001
From: Owen Pan <owenpiano at gmail.com>
Date: Mon, 4 Dec 2023 17:33:47 -0800
Subject: [PATCH] [clang-format][NFC] Use `prog` in clang-format-diff.py

This is a minor improvement to #73491.
---
 clang/tools/clang-format/clang-format-diff.py | 3 +--
 1 file changed, 1 insertion(+), 2 deletions(-)

diff --git a/clang/tools/clang-format/clang-format-diff.py b/clang/tools/clang-format/clang-format-diff.py
index b25ee8f433751..946e28163420d 100755
--- a/clang/tools/clang-format/clang-format-diff.py
+++ b/clang/tools/clang-format/clang-format-diff.py
@@ -37,9 +37,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