diff --git a/analyze.sh b/analyze.sh index 69c6182..8bc8022 100755 --- a/analyze.sh +++ b/analyze.sh @@ -33,7 +33,7 @@ clean_warnings() { } { bod(); } END { $0=null; bod(); } - ' + ' } color_red='\033[0;31m' @@ -71,7 +71,7 @@ pretty_output() { readarray -t -O "${#descs[@]}" descs < <( < "$file" grep -Po '@(query|reachable)\s+"[^\"]*"' \ | sed 's/@\w\+\s\+//; s/"//g') - + local outp ctr res ta tz; ctr=0; res=0; ta="$(date +%s)" while read -r outp; do tz="$(date +%s)" @@ -99,7 +99,7 @@ metaverif() { local awk_prep; awk_prep="${tmpdir}/${name}.o.pv" { - exc awk -f marzipan/marzipan.awk "${cpp_prep}" + exc awk -f marzipan/marzipan.awk "${cpp_prep}" echo -e "\nprocess main" } > "${awk_prep}" @@ -125,14 +125,14 @@ metaverif() { main() { set -e -o pipefail - cd -- "$( dirname -- "${BASH_SOURCE[0]}" )" + cd "$(dirname "$0")" tmpdir="target/proverif" mkdir -p "${tmpdir}" entries=() readarray -t -O "${#entries[@]}" entries < <( find analysis -iname '*.entry.mpv' | sort) - + local entry local procs; procs=() for entry in "${entries[@]}"; do @@ -144,5 +144,4 @@ main() { done } -# Do not execute main if sourced -(return 0 2>/dev/null) || main "$@" +main "$@" diff --git a/marzipan/src/__init__.py b/marzipan/src/__init__.py index 20fe8c5..6644bfa 100644 --- a/marzipan/src/__init__.py +++ b/marzipan/src/__init__.py @@ -18,9 +18,14 @@ def exc(argv, **kwargs): @click.command() @click.argument("file") @click.argument("log") -@click.argument("extra_args") -def run_proverif(file, log, extra_args): - return exc(["proverif", "-test", *extra_args, file], stderr=pkgs.sys.stderr) +@click.argument("extra_args", required=False) +def run_proverif(file, log, extra_args=[]): + if extra_args is None: + extra_args = [] + params = ["proverif", "-test", *extra_args, file] + print(params) + eprint(params) + return exc(params, stderr=pkgs.sys.stderr) def clean_warnings(): diff --git a/marzipan/src/analyze.sh b/marzipan/src/analyze.sh index 3704b29..cef01c7 100755 --- a/marzipan/src/analyze.sh +++ b/marzipan/src/analyze.sh @@ -10,7 +10,7 @@ run_proverif() { #local log; log="$1"; shift #exc proverif -test "${@}" "${file}" 2>&1 - exc rosenpass-marzipan run_proverif "${file}" "${@}" + exc rosenpass-marzipan run-proverif "${file}" "${@}" } clean_warnings() { @@ -145,6 +145,7 @@ analyze() { err_usage() { echo >&1 "USAGE: ${0} analyze PATH" + echo >&1 "The script will cd into PATH and continue there." exit 1 }