]> wagnertech.de Git - mDoc.git/blobdiff - python/mDoc/mdoc_extract.py
mdoku_0.2
[mDoc.git] / python / mDoc / mdoc_extract.py
index 6226d79e2c8190f31852c9c10193fbf01f41e38a..32a529e189e5444913a851ca07ce43f1777bcac7 100755 (executable)
@@ -8,17 +8,20 @@ import sys
 from mdoc import extractor
 import re
 
-usage = 'mdoc-extract <source> <class>'
+usage = 'mdoc-extract <source> <class> [target]'
 
 def command_dispatch(args):
     
     # check runtime parameters
     if len(args) < 2:
-        raise RuntimeError("mdoc-extract needs 2 arguments.")
+        raise RuntimeError("mdoc-extract needs 2/3 arguments.")
     
     file = args[0]
     classs = args[1]
-    target = re.sub(r'\..*', '.tex', file)
+    if len(args) == 3:
+        target = args[2]
+    else:
+        target = re.sub(r'\..*', '.tex', file)
     
     return extractor.extract(file, classs, target)