sys.exit(1) if globbing matches no files/directories
After more testing, I realized that I did not take into account the possibility that the wildcard pattern would not match anything. In that case, the following 'if not arguments' clause would run wmllint on the entire current directory - which could very well be something that you do not want!
This commit is contained in:
parent
45611d8fa6
commit
c471ec4847
1 changed files with 5 additions and 1 deletions
|
@ -2427,7 +2427,11 @@ if __name__ == '__main__':
|
|||
for arg in arguments:
|
||||
for wild in glob(arg):
|
||||
newargs.append(wild)
|
||||
arguments = newargs
|
||||
if newargs:
|
||||
arguments = newargs
|
||||
else:
|
||||
sys.stderr.write('wmllint: wildcard did not match any files or directories (%s)\n'%arguments)
|
||||
sys.exit(1)
|
||||
|
||||
if not arguments:
|
||||
arguments = ["."]
|
||||
|
|
Loading…
Add table
Reference in a new issue