Changeset View
Changeset View
Standalone View
Standalone View
swh/scanner/cli.py
Show All 29 Lines | |||||
@scanner.command(name='scan') | @scanner.command(name='scan') | ||||
@click.argument('path', required=True, type=click.Path(exists=True)) | @click.argument('path', required=True, type=click.Path(exists=True)) | ||||
@click.option('-u', '--api-url', | @click.option('-u', '--api-url', | ||||
default='https://archive.softwareheritage.org/api/1', | default='https://archive.softwareheritage.org/api/1', | ||||
metavar='API_URL', show_default=True, | metavar='API_URL', show_default=True, | ||||
help="url for the api request") | help="url for the api request") | ||||
@click.option('-f', '--format', | @click.option('-f', '--format', | ||||
type=click.Choice(['text', 'json'], case_sensitive=False), | type=click.Choice(['text', 'json', 'sunburst'], | ||||
case_sensitive=False), | |||||
default='text', | default='text', | ||||
help="select the output format") | help="select the output format") | ||||
@click.pass_context | @click.pass_context | ||||
def scan(ctx, path, api_url, format): | def scan(ctx, path, api_url, format): | ||||
"""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""" | ||||
api_url = parse_url(api_url) | api_url = parse_url(api_url) | ||||
Show All 9 Lines |