[llvm] dde24a8 - [llvm-objdump] add -v alias for --version
Nick Desaulniers via llvm-commits
llvm-commits at lists.llvm.org
Fri Apr 30 11:37:14 PDT 2021
Author: Nick Desaulniers
Date: 2021-04-30T11:26:36-07:00
New Revision: dde24a87c55f82d8c7b3bf3eafb10f2b9b2b9a01
URL: https://github.com/llvm/llvm-project/commit/dde24a87c55f82d8c7b3bf3eafb10f2b9b2b9a01
DIFF: https://github.com/llvm/llvm-project/commit/dde24a87c55f82d8c7b3bf3eafb10f2b9b2b9a01.diff
LOG: [llvm-objdump] add -v alias for --version
Used by the Linux kernel's CONFIG_X86_DECODER_SELFTEST.
Link: https://github.com/ClangBuiltLinux/linux/issues/1130
Reviewed By: MaskRay, jhenderson, rupprecht
Differential Revision: https://reviews.llvm.org/D101483
Added:
llvm/test/tools/llvm-objdump/version.test
Modified:
llvm/docs/CommandGuide/llvm-objdump.rst
llvm/tools/llvm-objdump/ObjdumpOpts.td
Removed:
################################################################################
diff --git a/llvm/docs/CommandGuide/llvm-objdump.rst b/llvm/docs/CommandGuide/llvm-objdump.rst
index 6e47b4a1bf153..d5b83bb4bb500 100644
--- a/llvm/docs/CommandGuide/llvm-objdump.rst
+++ b/llvm/docs/CommandGuide/llvm-objdump.rst
@@ -93,7 +93,7 @@ combined with other commands:
Display the unwind info of the input(s).
-.. option:: --version
+.. option:: -v, --version
Display the version of the :program:`llvm-objdump` executable. Does not stack
with other commands.
diff --git a/llvm/test/tools/llvm-objdump/version.test b/llvm/test/tools/llvm-objdump/version.test
new file mode 100644
index 0000000000000..afe2c1578e986
--- /dev/null
+++ b/llvm/test/tools/llvm-objdump/version.test
@@ -0,0 +1,5 @@
+RUN: llvm-objdump --version | FileCheck %s
+RUN: llvm-objdump -v | FileCheck %s
+
+CHECK: LLVM version
+CHECK: Registered Targets:
diff --git a/llvm/tools/llvm-objdump/ObjdumpOpts.td b/llvm/tools/llvm-objdump/ObjdumpOpts.td
index 17a6acdf83e1c..3b4bece6c187f 100644
--- a/llvm/tools/llvm-objdump/ObjdumpOpts.td
+++ b/llvm/tools/llvm-objdump/ObjdumpOpts.td
@@ -14,6 +14,8 @@ def help_hidden : Flag<["--"], "help-hidden">,
def version : Flag<["--"], "version">,
HelpText<"Display the version of this program">,
Group<grp_generic>;
+def : Flag<["-"], "v">, Alias<version>, HelpText<"Alias for --version">,
+ Group<grp_generic>;
More information about the llvm-commits
mailing list