Skip to content

Commit a7ba3d1

Browse files
committed
Added support for multiple input files on command line.
1 parent 61f6092 commit a7ba3d1

File tree

1 file changed

+6
-4
lines changed

1 file changed

+6
-4
lines changed

examples/test geocoder.py

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -116,8 +116,10 @@ def parse_boundary_file(filename, mapcode_function):
116116

117117

118118
if __name__ == "__main__":
119-
if len(sys.argv) != 2:
120-
print('Usage: {} <input file>'.format(sys.argv[0]))
119+
if len(sys.argv) == 1:
120+
print('Usage: %s <input file> [input file]' % (sys.argv[0]))
121121
else:
122-
parse_boundary_file(sys.argv[1], decode)
123-
parse_boundary_file(sys.argv[1], encode)
122+
for file in sys.argv[1::]:
123+
print('Processing', file)
124+
parse_boundary_file(file, decode)
125+
parse_boundary_file(file, encode)

0 commit comments

Comments
 (0)