Changeset View
Changeset View
Standalone View
Standalone View
swh/scanner/cli.py
Show First 20 Lines • Show All 128 Lines • ▼ Show 20 Lines | @click.option( | ||||
default="text", | default="text", | ||||
show_default=True, | show_default=True, | ||||
type=click.Choice(["text", "json", "ndjson", "sunburst"], case_sensitive=False), | type=click.Choice(["text", "json", "ndjson", "sunburst"], case_sensitive=False), | ||||
help="The output format", | help="The output format", | ||||
) | ) | ||||
@click.option( | @click.option( | ||||
"-i", "--interactive", is_flag=True, help="Show the result in a dashboard" | "-i", "--interactive", is_flag=True, help="Show the result in a dashboard" | ||||
) | ) | ||||
@click.option( | |||||
"-p", | |||||
"--policy", | |||||
default="bfs", | |||||
show_default=True, | |||||
type=click.Choice(["bfs", "filepriority", "dirpriority"]), | |||||
help="The scan policy.", | |||||
) | |||||
@click.pass_context | @click.pass_context | ||||
def scan(ctx, root_path, api_url, patterns, out_fmt, interactive): | def scan(ctx, root_path, api_url, patterns, out_fmt, interactive, policy): | ||||
"""Scan a source code project to discover files and directories already | """Scan a source code project to discover files and directories already | ||||
present in the archive""" | present in the archive""" | ||||
import swh.scanner.scanner as scanner | import swh.scanner.scanner as scanner | ||||
config = setup_config(ctx, api_url) | config = setup_config(ctx, api_url) | ||||
scanner.scan(config, root_path, patterns, out_fmt, interactive) | scanner.scan(config, root_path, patterns, out_fmt, interactive, policy) | ||||
@scanner.group("db", help="Manage local knowledge base for swh-scanner") | @scanner.group("db", help="Manage local knowledge base for swh-scanner") | ||||
@click.pass_context | @click.pass_context | ||||
def db(ctx): | def db(ctx): | ||||
pass | pass | ||||
▲ Show 20 Lines • Show All 89 Lines • Show Last 20 Lines |