]> git.openstreetmap.org Git - nominatim.git/blobdiff - nominatim/clicmd/api.py
docs: replace deprecated pages option
[nominatim.git] / nominatim / clicmd / api.py
index e0dfab79cc67b624fd63097110a3c959f9b559e3..ab7d16582cb5b8f8ba93800080166c4b7ecdb192 100644 (file)
@@ -1,3 +1,9 @@
+# SPDX-License-Identifier: GPL-2.0-only
+#
+# This file is part of Nominatim. (https://nominatim.org)
+#
+# Copyright (C) 2022 by the Nominatim developer community.
+# For a full list of authors see the git log.
 """
 Subcommand definitions for API calls from the command line.
 """
@@ -154,15 +160,13 @@ class APIReverse:
 
     @staticmethod
     def run(args):
-        params = dict(lat=args.lat, lon=args.lon)
+        params = dict(lat=args.lat, lon=args.lon, format=args.format)
         if args.zoom is not None:
             params['zoom'] = args.zoom
 
         for param, _ in EXTRADATA_PARAMS:
             if getattr(args, param):
                 params[param] = '1'
-        if args.format:
-            params['format'] = args.format
         if args.lang:
             params['accept-language'] = args.lang
         if args.polygon_output:
@@ -195,13 +199,11 @@ class APILookup:
 
     @staticmethod
     def run(args):
-        params = dict(osm_ids=','.join(args.ids))
+        params = dict(osm_ids=','.join(args.ids), format=args.format)
 
         for param, _ in EXTRADATA_PARAMS:
             if getattr(args, param):
                 params[param] = '1'
-        if args.format:
-            params['format'] = args.format
         if args.lang:
             params['accept-language'] = args.lang
         if args.polygon_output:
@@ -258,6 +260,8 @@ class APIDetails:
             params['class'] = args.object_class
         for name, _ in DETAILS_SWITCHES:
             params[name] = '1' if getattr(args, name) else '0'
+        if args.lang:
+            params['accept-language'] = args.lang
 
         return _run_api('details', args, params)