Page MenuHomeSoftware Heritage

cli.py
No OneTemporary

# Copyright (C) 2020 The Software Heritage developers
# See the AUTHORS file at the top-level directory of this distribution
# License: GNU General Public License version 3, or any later version
# See top-level LICENSE file for more information
import click
from swh.core.cli import CONTEXT_SETTINGS
from swh.scanner.scanner import run
@click.group(name='scanner', context_settings=CONTEXT_SETTINGS)
@click.pass_context
def scanner(ctx):
'''Software Heritage Scanner tools.'''
pass
@scanner.command(name='scan')
@click.argument('path', required=True)
@click.option('--host', '-h', default='localhost',
metavar='IP', show_default=True,
help="web api endpoint ip")
@click.option('--port', '-p', default='5080',
metavar='PORT', show_default=True,
help="web api endpoint port")
@click.pass_context
def scan(ctx, path, host, port):
result = run(path, host, port)
print(result)
def main():
return scanner(auto_envvar_prefix='SWH_SCANNER')
if __name__ == '__main__':
main()

File Metadata

Mime Type
text/plain
Expires
Thu, Jul 3, 11:15 AM (1 w, 22 h ago)
Storage Engine
blob
Storage Format
Raw Data
Storage Handle
3394130

Event Timeline