@@ -322,14 +322,25 @@ def cli(
322322
323323 logger .info ("Start processing file" , file = file )
324324 process_results = process_file (config , file , report_file )
325+
325326 if verbose == 0 :
326327 if skip_extraction :
327328 print_scan_report (process_results )
328329 else :
329330 print_report (process_results )
331+ print_output_dir (process_results )
330332 return process_results
331333
332334
335+ def print_output_dir (process_results : ProcessResult ):
336+ path = process_results .get_output_dir ()
337+
338+ if path :
339+ click .echo (f"Find output at { path } " )
340+ else :
341+ click .echo ("Too bad! Nothing was extracted." )
342+
343+
333344cli .context_class = UnblobContext
334345
335346
@@ -453,35 +464,36 @@ def print_report(reports: ProcessResult):
453464 valid_size += size
454465 total_size += size
455466
456- if total_size == 0 :
457- return
467+ console = Console ()
458468
459- summary = Panel (
460- f"""Extracted files: [#00FFC8]{ total_files } [/#00FFC8]
469+ if total_size :
470+ summary = Panel (
471+ f"""Extracted files: [#00FFC8]{ total_files } [/#00FFC8]
461472Extracted directories: [#00FFC8]{ total_dirs } [/#00FFC8]
462473Extracted links: [#00FFC8]{ total_links } [/#00FFC8]
463474Extraction directory size: [#00FFC8]{ human_size (extracted_size )} [/#00FFC8]
464475Chunks identification ratio: [#00FFC8]{ (valid_size / total_size ) * 100 :0.2f} %[/#00FFC8]""" ,
465- subtitle = "Summary" ,
466- title = f"unblob ({ get_version ()} )" ,
467- )
476+ subtitle = "Summary" ,
477+ title = f"unblob ({ get_version ()} )" ,
478+ )
468479
469- console = Console ()
470- console .print (summary )
480+ console .print (summary )
471481
472- chunks_table = Table (title = "Chunks distribution" )
473- chunks_table .add_column ("Chunk type" , justify = "left" , style = "#00FFC8" , no_wrap = True )
474- chunks_table .add_column ("Size" , justify = "center" , style = "#00FFC8" , no_wrap = True )
475- chunks_table .add_column ("Ratio" , justify = "center" , style = "#00FFC8" , no_wrap = True )
482+ # fmt: off
483+ chunks_table = Table (title = "Chunks distribution" )
484+ chunks_table .add_column ("Chunk type" , justify = "left" , style = "#00FFC8" , no_wrap = True )
485+ chunks_table .add_column ("Size" , justify = "center" , style = "#00FFC8" , no_wrap = True )
486+ chunks_table .add_column ("Ratio" , justify = "center" , style = "#00FFC8" , no_wrap = True )
487+ # fmt: on
476488
477- for handler , size in sorted (
478- chunks_distribution .items (), key = lambda item : item [1 ], reverse = True
479- ):
480- chunks_table .add_row (
481- handler .upper (), human_size (size ), f"{ (size / total_size ) * 100 :0.2f} %"
482- )
489+ for handler , size in sorted (
490+ chunks_distribution .items (), key = lambda item : item [1 ], reverse = True
491+ ):
492+ chunks_table .add_row (
493+ handler .upper (), human_size (size ), f"{ (size / total_size ) * 100 :0.2f} %"
494+ )
483495
484- console .print (chunks_table )
496+ console .print (chunks_table )
485497
486498 if len (reports .errors ):
487499 errors_table = Table (title = "Encountered errors" )
0 commit comments