-
Notifications
You must be signed in to change notification settings - Fork 45
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
CM-29953 - Scanning many paths in one CLI run (#183)
- Loading branch information
Showing
7 changed files
with
50 additions
and
33 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,15 +1,17 @@ | ||
from typing import Tuple | ||
|
||
import click | ||
|
||
from cycode.cli.commands.scan.code_scanner import scan_disk_files | ||
from cycode.cyclient import logger | ||
|
||
|
||
@click.command(short_help='Scan the files in the path provided in the command.') | ||
@click.argument('path', nargs=1, type=click.Path(exists=True, resolve_path=True), required=True) | ||
@click.argument('paths', nargs=-1, type=click.Path(exists=True, resolve_path=True), required=True) | ||
@click.pass_context | ||
def path_command(context: click.Context, path: str) -> None: | ||
def path_command(context: click.Context, paths: Tuple[str]) -> None: | ||
progress_bar = context.obj['progress_bar'] | ||
progress_bar.start() | ||
|
||
logger.debug('Starting path scan process, %s', {'path': path}) | ||
scan_disk_files(context, path) | ||
logger.debug('Starting path scan process, %s', {'paths': paths}) | ||
scan_disk_files(context, paths) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters