yml2/yml2proc.py
changeset 67 db1b6e9a6bb7
parent 62 00a196f8d14a
--- a/yml2/yml2proc.py	Thu Mar 19 17:17:22 2020 +0100
+++ b/yml2/yml2proc.py	Thu Mar 19 17:17:47 2020 +0100
@@ -24,7 +24,7 @@
 from yml2.pyPEG import parse, u
 import yml2.backend as backend
 
-YML_DEFAULT_PATH = [os.path.dirname(backend.__file__)]
+YML_DEFAULT_PATHS = [os.path.dirname(backend.__file__)]
 
 def printInfo(option, opt_str, value, parser):
     sys.stdout.write(__doc__)
@@ -41,6 +41,7 @@
     sys.stderr.write(msg)
 
 def main():
+    dirsepname = {':': 'a colon', ';': 'a semicolon'}.get(os.path.pathsep, "a '%s'" % os.path.pathsep)
     optParser = OptionParser()
     optParser.add_option("-C", "--old-syntax", action="store_true", dest="old_syntax",
             help="syntax of YML 2 version 1.x (compatibility mode)", default=False)
@@ -55,7 +56,7 @@
     optParser.add_option("-E", "--encoding", dest="encoding", metavar="ENCODING", default=locale.getdefaultlocale()[1],
             help="encoding of input files (default to locale)")
     optParser.add_option("-I", "--include", dest="includePathText", metavar="INCLUDE_PATH",
-            help="precede YML_PATH by a colon separated INCLUDE_PATH to search for include files")
+            help="precede YML_PATH by %s separated INCLUDE_PATH to search for include files" % dirsepname)
     optParser.add_option("-m", "--omit-empty-parm-tags", action="store_true", dest="omitemptyparm",
             help="does nothing (only there for compatibility reasons)", default=False)
     optParser.add_option("-M", "--empty-input-document", action="store_true", dest="emptyinput",
@@ -91,11 +92,11 @@
         backend.emitlinenumbers = True
 
     if options.includePathText:
-        backend.includePath = options.includePathText.split(':')
+        backend.includePath = options.includePathText.split(os.path.pathsep)
 
     backend.encoding = options.encoding
 
-    dirs = os.environ.get('YML_PATH', '.').split(':') + YML_DEFAULT_PATH
+    dirs = os.environ.get('YML_PATH', '.').split(os.path.pathsep) + YML_DEFAULT_PATHS
     backend.includePath.extend(dirs)
 
     if options.xml2yml: