Changeset View
Changeset View
Standalone View
Standalone View
swh/scanner/cli.py
Show First 20 Lines • Show All 136 Lines • ▼ Show 20 Lines | |||||
@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( | @click.option( | ||||
"-p", | "-p", | ||||
"--policy", | "--policy", | ||||
default="auto", | default="auto", | ||||
show_default=True, | show_default=True, | ||||
type=click.Choice(["auto", "bfs", "greedybfs", "filepriority", "dirpriority"]), | type=click.Choice( | ||||
["auto", "bfs", "greedybfs", "filepriority", "dirpriority", "randomdir"] | |||||
), | |||||
help="The scan policy.", | help="The scan policy.", | ||||
) | ) | ||||
@click.option( | @click.option( | ||||
"-e", | "-e", | ||||
"--extra-info", | "--extra-info", | ||||
"extra_info", | "extra_info", | ||||
multiple=True, | multiple=True, | ||||
type=click.Choice(["origin"]), | type=click.Choice(["origin"]), | ||||
Show All 19 Lines | def scan(ctx, root_path, api_url, patterns, out_fmt, interactive, policy, extra_info): | ||||
\b | \b | ||||
filepriority: scan all the source code file contents, checking only unset | filepriority: scan all the source code file contents, checking only unset | ||||
directories. (useful if the codebase contains a lot of source files) | directories. (useful if the codebase contains a lot of source files) | ||||
dirpriority: scan all the source code directories and check only unknown | dirpriority: scan all the source code directories and check only unknown | ||||
directory contents. | directory contents. | ||||
randomdir: scan the source code using a random Merkle search on directories. | |||||
Other information about software artifacts could be specified with the -e/ | Other information about software artifacts could be specified with the -e/ | ||||
--extra-info option:\n | --extra-info option:\n | ||||
\b | \b | ||||
origin: search the origin url of each source code files/dirs using the in-memory | origin: search the origin url of each source code files/dirs using the in-memory | ||||
compressed graph.""" | compressed graph.""" | ||||
import swh.scanner.scanner as scanner | import swh.scanner.scanner as scanner | ||||
config = setup_config(ctx, api_url) | config = setup_config(ctx, api_url) | ||||
▲ Show 20 Lines • Show All 99 Lines • Show Last 20 Lines |