5959from .components import Components
6060from .constants import (
6161 DEFAULT_API_TIMEOUT ,
62+ DEFAULT_HFH_DEPTH ,
63+ DEFAULT_HFH_MIN_ACCEPTED_SCORE ,
6264 DEFAULT_HFH_RANK_THRESHOLD ,
65+ DEFAULT_HFH_RECURSIVE_THRESHOLD ,
6366 DEFAULT_POST_SIZE ,
6467 DEFAULT_RETRY ,
6568 DEFAULT_TIMEOUT ,
@@ -869,6 +872,27 @@ def setup_args() -> None: # noqa: PLR0912, PLR0915
869872 help = 'Filter results to only show those with rank value at or below this threshold (e.g., --rank-threshold 3 '
870873 'returns results with rank 1, 2, or 3). Lower rank values indicate higher quality matches.' ,
871874 )
875+ p_folder_scan .add_argument (
876+ '--depth' ,
877+ type = int ,
878+ default = DEFAULT_HFH_DEPTH ,
879+ help = f'Defines how deep to scan the root directory (optional - default { DEFAULT_HFH_DEPTH } )' ,
880+ )
881+ p_folder_scan .add_argument (
882+ '--recursive-threshold' ,
883+ type = float ,
884+ default = DEFAULT_HFH_RECURSIVE_THRESHOLD ,
885+ help = f'Minimum score threshold to consider a match (optional - default: { DEFAULT_HFH_RECURSIVE_THRESHOLD } )' ,
886+ )
887+ p_folder_scan .add_argument (
888+ '--min-accepted-score' ,
889+ type = float ,
890+ default = DEFAULT_HFH_MIN_ACCEPTED_SCORE ,
891+ help = (
892+ 'Only show results with a score at or above this threshold '
893+ f'(optional - default: { DEFAULT_HFH_MIN_ACCEPTED_SCORE } )'
894+ ),
895+ )
872896 p_folder_scan .set_defaults (func = folder_hashing_scan )
873897
874898 # Sub-command: folder-hash
@@ -887,6 +911,12 @@ def setup_args() -> None: # noqa: PLR0912, PLR0915
887911 default = 'json' ,
888912 help = 'Result output format (optional - default: json)' ,
889913 )
914+ p_folder_hash .add_argument (
915+ '--depth' ,
916+ type = int ,
917+ default = DEFAULT_HFH_DEPTH ,
918+ help = f'Defines how deep to hash the root directory (optional - default { DEFAULT_HFH_DEPTH } )' ,
919+ )
890920 p_folder_hash .set_defaults (func = folder_hash )
891921
892922 # Output options
@@ -2456,6 +2486,9 @@ def folder_hashing_scan(parser, args):
24562486 client = client ,
24572487 scanoss_settings = scanoss_settings ,
24582488 rank_threshold = args .rank_threshold ,
2489+ depth = args .depth ,
2490+ recursive_threshold = args .recursive_threshold ,
2491+ min_accepted_score = args .min_accepted_score ,
24592492 )
24602493
24612494 if scanner .scan ():
@@ -2489,6 +2522,7 @@ def folder_hash(parser, args):
24892522 scan_dir = args .scan_dir ,
24902523 config = folder_hasher_config ,
24912524 scanoss_settings = scanoss_settings ,
2525+ depth = args .depth ,
24922526 )
24932527
24942528 folder_hasher .hash_directory (args .scan_dir )
0 commit comments