]> git.donarmstrong.com Git - lilypond.git/commitdiff
output-distance: --output-dir option
authorHan-Wen Nienhuys <hanwen@xs4all.nl>
Wed, 20 Dec 2006 11:26:28 +0000 (12:26 +0100)
committerHan-Wen Nienhuys <hanwen@xs4all.nl>
Wed, 20 Dec 2006 11:26:28 +0000 (12:26 +0100)
buildscripts/output-distance.py

index a04df6b54021a7785b88ab9a0b87420bcecdc19f..f19886afbf3ecc4873f8e627686e7d00cdf08ee5 100644 (file)
@@ -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()