Skip to content

Commit ab3c67d

Browse files
committed
change format to responseformat (format is a reserved word in Python)
1 parent b2ce7a1 commit ab3c67d

File tree

1 file changed

+5
-5
lines changed

1 file changed

+5
-5
lines changed

overpass/cli.py

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -10,20 +10,20 @@
1010
@click.option('--timeout', default=25, help='Timeout in seconds.')
1111
@click.option('--endpoint', default='http://overpass-api.de/api/interpreter',
1212
help='URL of your prefered API.')
13-
@click.option('--format', default='geojson', help="""Format to save the data.
13+
@click.option('--responseformat', default='geojson', help="""Format to save the data.
1414
Options are 'geojson' and 'osm'. Default format is geojson.""")
1515
@click.argument('query', type=str)
1616
@click.argument('output_file', type=click.Path())
17-
def cli(timeout, endpoint, format, query, output_file):
17+
def cli(timeout, endpoint, responseformat, query, output_file):
1818
"""Run query and save the result in output_file"""
1919

2020
api = overpass.API(timeout=timeout, endpoint=endpoint)
2121

22-
if format not in api.SUPPORTED_FORMATS:
22+
if responseformat not in api.SUPPORTED_FORMATS:
2323
print("format {} not supported. Supported formats: {}".format(
24-
format,
24+
responseformat,
2525
api.SUPPORTED_FORMATS.join(", ")))
26-
result = api.Get(query, responseformat=format)
26+
result = api.Get(query, responseformat=responseformat)
2727
with open(output_file, 'w') as f:
2828
if responseformat=="geojson":
2929
geojson.dump(result, f, indent=2, sort_keys=True)

0 commit comments

Comments
 (0)