[PATCH] D74553: Fix handling of --version in lit
serge via Phabricator via llvm-commits
llvm-commits at lists.llvm.org
Thu Feb 13 12:43:11 PST 2020
This revision was automatically updated to reflect the committed changes.
Closed by commit rG1d4849379f71: Fix handling of --version in lit (authored by serge-sans-paille).
Repository:
rG LLVM Github Monorepo
CHANGES SINCE LAST ACTION
https://reviews.llvm.org/D74553/new/
https://reviews.llvm.org/D74553
Files:
llvm/utils/lit/lit/cl_arguments.py
llvm/utils/lit/lit/main.py
llvm/utils/lit/tests/version.py
Index: llvm/utils/lit/tests/version.py
===================================================================
--- /dev/null
+++ llvm/utils/lit/tests/version.py
@@ -0,0 +1,5 @@
+# Basic sanity check that --version works.
+#
+# RUN: %{lit} --version | FileCheck %s
+#
+# CHECK: lit {{[0-9]+\.[0-9]+\.[0-9]+[a-zA-Z0-9]*}}
Index: llvm/utils/lit/lit/main.py
===================================================================
--- llvm/utils/lit/lit/main.py
+++ llvm/utils/lit/lit/main.py
@@ -21,10 +21,6 @@
def main(builtin_params={}):
opts = lit.cl_arguments.parse_args()
- if opts.show_version:
- print("lit %s" % lit.__version__)
- return
-
params = create_params(builtin_params, opts.user_params)
is_windows = platform.system() == 'Windows'
Index: llvm/utils/lit/lit/cl_arguments.py
===================================================================
--- llvm/utils/lit/lit/cl_arguments.py
+++ llvm/utils/lit/lit/cl_arguments.py
@@ -15,7 +15,9 @@
parser.add_argument("--version",
dest="show_version",
help="Show version and exit",
- action="store_true")
+ version="lit " + lit.__version__,
+ action="version")
+
parser.add_argument("-j", "--threads", "--workers",
dest="workers",
metavar="N",
-------------- next part --------------
A non-text attachment was scrubbed...
Name: D74553.244510.patch
Type: text/x-patch
Size: 1321 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20200213/6df8567f/attachment.bin>
More information about the llvm-commits
mailing list