wmllint, wmlscope and wmlindent: fixed bug caused by Windows' command prompt appending double quotes to arguments

This commit is contained in:
Elvish_Hunter 2013-02-23 13:04:12 +00:00
parent 47b8f92309
commit 8200214e9b
4 changed files with 19 additions and 0 deletions

View file

@ -99,6 +99,8 @@ Version 1.11.1+svn:
* Changed: Increased the pango cairo dependency to version 1.24.4.
* Fixed a display artifact (halos not cleared) when WML moves a unit.
* Improved the display of vision costs in the unit help.
* Fixed wmllint, wmlscope and wmlindent not working correctly on Windows if a
command line argument ends with a backslash
Version 1.11.1:
* AI:

View file

@ -302,5 +302,10 @@ if __name__ == '__main__':
quiet = True
elif opt in ('-v', '--verbose'):
verbose += 1
# in certain situations, Windows' command prompt appends a double quote
# to the command line parameters. This block takes care of this issue.
for i,arg in enumerate(arguments):
if arg.endswith('"'):
arguments[i] = arg[:-1]
convertor(lambda n, f1, f2: reindent(n, f1, f2),
arguments, "|".join(exclude))

View file

@ -2328,6 +2328,12 @@ if __name__ == '__main__':
if not arguments:
arguments = ["."]
# in certain situations, Windows' command prompt appends a double quote
# to the command line parameters. This block takes care of this issue.
for i,arg in enumerate(arguments):
if arg.endswith('"'):
arguments[i] = arg[:-1]
for dir in arguments:
ofp = None
for fn in allcfgfiles(dir):

View file

@ -425,6 +425,12 @@ Usage: macroscope [options] dirpath
elif switch in ('-w', '--warnlevel'):
warnlevel = int(val)
# in certain situations, Windows' command prompt appends a double quote
# to the command line parameters. This block takes care of this issue.
for i,arg in enumerate(arguments):
if arg.endswith('"'):
arguments[i] = arg[:-1]
forceused = "|".join(forceused)
if len(arguments):
dirpath = arguments