From cb1903a33752ef4c1a4f4bc86e307770e45aa4f5 Mon Sep 17 00:00:00 2001 From: Han-Wen Nienhuys Date: Wed, 20 Dec 2006 12:26:28 +0100 Subject: [PATCH] output-distance: --output-dir option --- buildscripts/output-distance.py | 23 ++++++++++++++++------- 1 file changed, 16 insertions(+), 7 deletions(-) diff --git a/buildscripts/output-distance.py b/buildscripts/output-distance.py index a04df6b540..f19886afbf 100644 --- a/buildscripts/output-distance.py +++ b/buildscripts/output-distance.py @@ -911,9 +911,17 @@ def main (): type="float", help='threshold for geometric distance') - (o,a) = p.parse_args () - if o.run_test: + p.add_option ('-o', '--output-dir', + dest="output_dir", + default=None, + action="store", + type="string", + help='where to put the test results [tree2/compare-tree1tree2]') + + (options, a) = p.parse_args () + + if options.run_test: run_tests () sys.exit (0) @@ -922,13 +930,14 @@ def main (): sys.exit (2) global inspect_max_count - inspect_max_count = o.max_count + inspect_max_count = options.max_count - name = a[0].replace ('/', '') - name = shorten_string (name) + name = options.output_dir + if not name: + name = a[0].replace ('/', '') + name = os.path.join (a[1], 'compare-' + shorten_string (name)) - compare_trees (a[0], a[1], os.path.join (a[1], 'compare-' + name), - o.threshold) + compare_trees (a[0], a[1], name, options.threshold) if __name__ == '__main__': main() -- 2.39.5