[llvm] r305155 - [opt-viewer] Include default values in help output
Brian Gesiak via llvm-commits
llvm-commits at lists.llvm.org
Sat Jun 10 14:33:27 PDT 2017
Author: modocache
Date: Sat Jun 10 16:33:27 2017
New Revision: 305155
URL: http://llvm.org/viewvc/llvm-project?rev=305155&view=rev
Log:
[opt-viewer] Include default values in help output
Summary:
Python's argparse module includes a `%(default)s` format specifier that
can be used to print the default value of an option in its help text.
Use this for opt-viewer utilities' `--jobs` arguments.
Reviewers: anemet
Reviewed By: anemet
Subscribers: llvm-commits, fhahn
Differential Revision: https://reviews.llvm.org/D34081
Modified:
llvm/trunk/utils/opt-viewer/opt-diff.py
llvm/trunk/utils/opt-viewer/opt-stats.py
llvm/trunk/utils/opt-viewer/opt-viewer.py
Modified: llvm/trunk/utils/opt-viewer/opt-diff.py
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/utils/opt-viewer/opt-diff.py?rev=305155&r1=305154&r2=305155&view=diff
==============================================================================
--- llvm/trunk/utils/opt-viewer/opt-diff.py (original)
+++ llvm/trunk/utils/opt-viewer/opt-diff.py Sat Jun 10 16:33:27 2017
@@ -43,7 +43,7 @@ if __name__ == '__main__':
'-j',
default=cpu_count(),
type=int,
- help='Max job count (defaults to current CPU count)')
+ help='Max job count (defaults to %(default)s, the current CPU count)')
parser.add_argument('--output', '-o', default='diff.opt.yaml')
args = parser.parse_args()
Modified: llvm/trunk/utils/opt-viewer/opt-stats.py
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/utils/opt-viewer/opt-stats.py?rev=305155&r1=305154&r2=305155&view=diff
==============================================================================
--- llvm/trunk/utils/opt-viewer/opt-stats.py (original)
+++ llvm/trunk/utils/opt-viewer/opt-stats.py Sat Jun 10 16:33:27 2017
@@ -21,7 +21,7 @@ if __name__ == '__main__':
'-j',
default=cpu_count(),
type=int,
- help='Max job count (defaults to current CPU count)')
+ help='Max job count (defaults to %(default)s, the current CPU count)')
args = parser.parse_args()
if len(args.yaml_files) == 0:
Modified: llvm/trunk/utils/opt-viewer/opt-viewer.py
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/utils/opt-viewer/opt-viewer.py?rev=305155&r1=305154&r2=305155&view=diff
==============================================================================
--- llvm/trunk/utils/opt-viewer/opt-viewer.py (original)
+++ llvm/trunk/utils/opt-viewer/opt-viewer.py Sat Jun 10 16:33:27 2017
@@ -208,7 +208,7 @@ if __name__ == '__main__':
'-j',
default=cpu_count(),
type=int,
- help='Max job count (defaults to current CPU count)')
+ help='Max job count (defaults to %(default)s, the current CPU count)')
parser.add_argument(
'-source-dir',
'-s',
More information about the llvm-commits
mailing list