mirror of
https://github.com/rosenpass/rosenpass.git
synced 2026-02-28 14:33:37 -08:00
feat: add CLI param for configurable output/target directory
Co-authored-by: Anja Rabich <a.rabich@uni-luebeck.de>
This commit is contained in:
@@ -32,9 +32,10 @@
|
|||||||
* ~~return an exit status that is meaningful for CI~~
|
* ~~return an exit status that is meaningful for CI~~
|
||||||
* ~~exception handling in analyze() and in run_proverif()~~
|
* ~~exception handling in analyze() and in run_proverif()~~
|
||||||
* ~~refactor filtering in run_proverif (see karo's comment)~~
|
* ~~refactor filtering in run_proverif (see karo's comment)~~
|
||||||
|
* ~configurable target directory~
|
||||||
|
|
||||||
## Next Steps
|
## Next Steps
|
||||||
* configurable target directory
|
|
||||||
* do not assume that the repo path has subdir analysis and marzipan
|
* do not assume that the repo path has subdir analysis and marzipan
|
||||||
* integrate marzipan.awk into Python, somehow
|
* integrate marzipan.awk into Python, somehow
|
||||||
* rewrite marzipan.awk into Python/LARK
|
* rewrite marzipan.awk into Python/LARK
|
||||||
|
|||||||
@@ -158,14 +158,18 @@ def pretty_output(file_path):
|
|||||||
(res, ctr, ta) = pretty_output_step(file_path, line, expected, descs, res, ctr, ta)
|
(res, ctr, ta) = pretty_output_step(file_path, line, expected, descs, res, ctr, ta)
|
||||||
|
|
||||||
|
|
||||||
def get_target_dir(path):
|
def get_target_dir(path, output):
|
||||||
return pkgs.os.path.join(path, target_subdir)
|
if output is not None and not output == "":
|
||||||
|
return pkgs.pathlib.Path(output)
|
||||||
|
else:
|
||||||
|
return pkgs.os.path.join(path, target_subdir)
|
||||||
|
|
||||||
|
|
||||||
@main.command()
|
@main.command()
|
||||||
|
@click.option('--output', 'output', required=False)
|
||||||
@click.argument("repo_path")
|
@click.argument("repo_path")
|
||||||
def analyze(repo_path):
|
def analyze(repo_path, output):
|
||||||
target_dir = get_target_dir(repo_path)
|
target_dir = get_target_dir(repo_path, output)
|
||||||
pkgs.os.makedirs(target_dir, exist_ok=True)
|
pkgs.os.makedirs(target_dir, exist_ok=True)
|
||||||
|
|
||||||
entries = []
|
entries = []
|
||||||
@@ -182,10 +186,11 @@ def analyze(repo_path):
|
|||||||
|
|
||||||
|
|
||||||
@main.command()
|
@main.command()
|
||||||
|
@click.option('--output', 'output', required=False)
|
||||||
@click.argument("repo_path")
|
@click.argument("repo_path")
|
||||||
def clean(repo_path):
|
def clean(repo_path, output):
|
||||||
cleans_failed = 0
|
cleans_failed = 0
|
||||||
target_dir = get_target_dir(repo_path)
|
target_dir = get_target_dir(repo_path, output)
|
||||||
if pkgs.os.path.isdir(target_dir):
|
if pkgs.os.path.isdir(target_dir):
|
||||||
for filename in pkgs.os.listdir(target_dir):
|
for filename in pkgs.os.listdir(target_dir):
|
||||||
file_path = pkgs.os.path.join(target_dir, filename)
|
file_path = pkgs.os.path.join(target_dir, filename)
|
||||||
|
|||||||
Reference in New Issue
Block a user