@@ -29,7 +29,7 @@ def setup_args() -> argparse.Namespace:
2929
3030 # Base parameters
3131 parser .add_argument ('patch_files' , type = str , nargs = '+' , help = 'Input patch file paths, multiple files can be specified' )
32- parser .add_argument ('--out-dir ' , type = str , help = 'Output directory path' )
32+ parser .add_argument ('--outdir ' , type = str , help = 'Output directory path' )
3333
3434 # Split parameters
3535 parser .add_argument ('--level' , type = int , default = 1 , help = 'Merge level limit (default: 1)' )
@@ -45,8 +45,8 @@ def setup_args() -> argparse.Namespace:
4545
4646 args = parser .parse_args ()
4747 # Validate arguments
48- if not args .dry_run and not args .out_dir :
49- parser .error ("--out-dir is required in non-dry-run mode" )
48+ if not args .dry_run and not args .outdir :
49+ parser .error ("--outdir is required in non-dry-run mode" )
5050
5151 # Configure logging
5252 setup_logging (args .log_level )
@@ -55,8 +55,8 @@ def setup_args() -> argparse.Namespace:
5555 # Print argument information
5656 logger .info ("Current arguments:" )
5757 logger .info (f" Input files: { ', ' .join (args .patch_files )} " )
58- if args .out_dir :
59- logger .info (f" Output directory: { args .out_dir } " )
58+ if args .outdir :
59+ logger .info (f" Output directory: { args .outdir } " )
6060 logger .info (f" Merge level: { args .level } " )
6161 logger .info (f" File count threshold: { args .threshold } " )
6262 logger .info (f" Log level: { args .log_level } " )
@@ -133,12 +133,12 @@ def split_patch(patch: Patch, level: int, threshold: int) -> List[Patch]:
133133 return root .to_patches ()
134134
135135
136- def output_patches (patches : List [Patch ], out_dir : str , dry_run : bool ) -> None :
136+ def output_patches (patches : List [Patch ], outdir : str , dry_run : bool ) -> None :
137137 """Output processed patches to specified directory
138138
139139 Args:
140140 patches: List of patches to output
141- out_dir : Output directory path
141+ outdir : Output directory path
142142 dry_run: If True, only print info without actually writing files
143143 """
144144 if dry_run :
@@ -148,10 +148,10 @@ def output_patches(patches: List[Patch], out_dir: str, dry_run: bool) -> None:
148148 logger .info (f"Patch { i :03d} _{ normalized_path } .patch" )
149149 return
150150
151- os .makedirs (out_dir , exist_ok = True )
151+ os .makedirs (outdir , exist_ok = True )
152152 for i , patch in enumerate (patches , 1 ):
153153 normalized_path = patch .path .lstrip ('/' ).replace ('/' , '_' )
154- output_file = os .path .join (out_dir , f"{ i :03d} _{ normalized_path } .patch" )
154+ output_file = os .path .join (outdir , f"{ i :03d} _{ normalized_path } .patch" )
155155
156156 try :
157157 patch .path = output_file
@@ -174,7 +174,7 @@ def main() -> None:
174174 patches = split_patch (combined_patch , args .level , args .threshold )
175175
176176 # Output results
177- output_patches (patches , args .out_dir , args .dry_run )
177+ output_patches (patches , args .outdir , args .dry_run )
178178
179179 except Exception as e :
180180 logger .error (f"An error occurred during processing: { e } " )
0 commit comments