@@ -4335,7 +4335,10 @@ def main(argv):
4335
4335
cmdline .add_argument ("-o" , "--output" , type = str )
4336
4336
cmdline .add_argument ("-v" , "--verbose" , action = 'store_true' )
4337
4337
cmdline .add_argument ("--converters" , action = 'store_true' )
4338
- cmdline .add_argument ("--make" , action = 'store_true' )
4338
+ cmdline .add_argument ("--make" , action = 'store_true' ,
4339
+ help = "Walk --srcdir to run over all relevant files." )
4340
+ cmdline .add_argument ("--srcdir" , type = str , default = os .curdir ,
4341
+ help = "The directory tree to walk in --make mode." )
4339
4342
cmdline .add_argument ("filename" , type = str , nargs = "*" )
4340
4343
ns = cmdline .parse_args (argv )
4341
4344
@@ -4406,7 +4409,12 @@ def main(argv):
4406
4409
print ()
4407
4410
cmdline .print_usage ()
4408
4411
sys .exit (- 1 )
4409
- for root , dirs , files in os .walk ('.' ):
4412
+ if not ns .srcdir :
4413
+ print ("Usage error: --srcdir must not be empty with --make." )
4414
+ print ()
4415
+ cmdline .print_usage ()
4416
+ sys .exit (- 1 )
4417
+ for root , dirs , files in os .walk (ns .srcdir ):
4410
4418
for rcs_dir in ('.svn' , '.git' , '.hg' , 'build' , 'externals' ):
4411
4419
if rcs_dir in dirs :
4412
4420
dirs .remove (rcs_dir )
0 commit comments