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
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@305155
91177308-0d34-0410-b5e6-
96231b3b80d8
'-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()
'-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:
'-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',