aboutsummaryrefslogtreecommitdiffhomepage
path: root/cc_cli.py
diff options
context:
space:
mode:
authorAdam Janovsky2021-05-14 14:53:53 +0200
committerAdam Janovsky2021-05-14 14:53:53 +0200
commitc019ccb5c0831bc9047a2ed36b4f9d1d3c6bd4bc (patch)
tree1d71dcfd03144d0ed2af1886d6fed3118b91f226 /cc_cli.py
parentb1dcb367392a0e0ef767e05f4132548556a6ae54 (diff)
downloadsec-certs-c019ccb5c0831bc9047a2ed36b4f9d1d3c6bd4bc.tar.gz
sec-certs-c019ccb5c0831bc9047a2ed36b4f9d1d3c6bd4bc.tar.zst
sec-certs-c019ccb5c0831bc9047a2ed36b4f9d1d3c6bd4bc.zip
adds maintenances action to cli
Diffstat (limited to 'cc_cli.py')
-rw-r--r--cc_cli.py7
1 files changed, 6 insertions, 1 deletions
diff --git a/cc_cli.py b/cc_cli.py
index 1d9aabcb..41677882 100644
--- a/cc_cli.py
+++ b/cc_cli.py
@@ -13,7 +13,7 @@ logger = logging.getLogger(__name__)
@click.command()
-@click.argument('actions', required=True, nargs=-1, type=click.Choice(['all', 'build', 'download', 'convert', 'analyze'], case_sensitive=False))
+@click.argument('actions', required=True, nargs=-1, type=click.Choice(['all', 'build', 'download', 'convert', 'analyze', 'maintenances'], case_sensitive=False))
@click.option('-o', '--output', type=click.Path(file_okay=False, dir_okay=True, writable=True, readable=True),
help='Path where the output of the experiment will be stored. May overwrite existing content.')
@click.option('-c', '--config', 'configpath', default=None, type=click.Path(file_okay=True, dir_okay=False, writable=True, readable=True),
@@ -92,6 +92,11 @@ def main(configpath: Optional[str], actions: List[str], inputpath: Optional[Path
dset.extract_data()
dset.compute_heuristics()
+ if 'maintenances' in actions:
+ if not dset.state.meta_sources_parsed:
+ print('Error: You want to process maintenance updates, but the data from commoncriteria.org was not parsed. You must use \'build\' action first.')
+ sys.exit(1)
+
end = datetime.now()
logger.info(f'The computation took {(end-start)} seconds.')