gen_makefile.py: set nargs=? for --jobs

Allow calling gen_makefile.py with --jobs without any argument, and
behave the same as if --jobs was not passed. This fixes calling
gen_makefile.py initially without --jobs, and then running "make regen"
which will cause gen_makefile.py to get called with --jobs with no
argument.
This commit is contained in:
Oliver Smith 2022-08-17 12:05:53 +02:00
parent 74ef7bf547
commit 51b8061749
1 changed files with 1 additions and 1 deletions

View File

@ -84,7 +84,7 @@ parser.add_argument('-p', '--push-url', dest='push_url', default='',
parser.add_argument('-o', '--output', dest='output', default='Makefile',
help='''Makefile filename (default: 'Makefile').''')
parser.add_argument('-j', '--jobs', dest='jobs', default='$(nproc)',
parser.add_argument('-j', '--jobs', dest='jobs', default='$(nproc)', nargs='?', const='$(nproc)',
help='''-j option to pass to 'make'.''')
parser.add_argument('-I', '--sudo-make-install', dest='sudo_make_install',