Skip to content

Commit d168127

Browse files
steven-esserpombredanne
authored andcommitted
#262: shallow extraction flag working.
1 parent 4df6e42 commit d168127

File tree

1 file changed

+3
-2
lines changed

1 file changed

+3
-2
lines changed

src/scancode/extract_cli.py

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -86,12 +86,13 @@ class ExtractCommand(utils.BaseCommand):
8686

8787
@click.option('--verbose', is_flag=True, default=False, help='Print verbose file-by-file progress messages.')
8888
@click.option('--quiet', is_flag=True, default=False, help='Do not print any summary or progress message.')
89+
@click.option('--shallow', is_flag=True, default=False)
8990

9091
@click.help_option('-h', '--help')
9192
@click.option('--about', is_flag=True, is_eager=True, callback=print_about, help='Show information about ScanCode and licensing and exit.')
9293
@click.option('--version', is_flag=True, is_eager=True, callback=print_version, help='Show the version and exit.')
9394

94-
def extractcode(ctx, input, verbose, quiet, *args, **kwargs): # @ReservedAssignment
95+
def extractcode(ctx, input, verbose, quiet, shallow, *args, **kwargs): # @ReservedAssignment
9596
"""extract archives and compressed files found in the <input> file or directory tree.
9697
9798
Use this command before scanning proper as an <input> preparation step.
@@ -156,7 +157,7 @@ def display_extract_summary():
156157
if not quiet:
157158
echo_stderr('Extracting archives...', fg='green')
158159

159-
with utils.progressmanager(extract_archives(abs_location), item_show_func=extract_event,
160+
with utils.progressmanager(extract_archives(abs_location, recurse=not shallow), item_show_func=extract_event,
160161
verbose=verbose, quiet=quiet) as extraction_events:
161162
for xev in extraction_events:
162163
if xev.done and (xev.warnings or xev.errors):

0 commit comments

Comments
 (0)