Skip to content

Commit

Permalink
Merge pull request #3389 from mtmail/cli-autodiscover-valid-formats
Browse files Browse the repository at this point in the history
CLI: get valid --format values via autodiscover
  • Loading branch information
lonvia authored Apr 9, 2024
2 parents 8c54f9d + 28444d9 commit 1a0f851
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion nominatim/clicmd/api.py
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@
import nominatim.api as napi
import nominatim.api.v1 as api_output
from nominatim.api.v1.helpers import zoom_to_rank, deduplicate_results
from nominatim.api.v1.format import dispatch as formatting
import nominatim.api.logging as loglib

# Do not repeat documentation of subcommand classes.
Expand Down Expand Up @@ -44,7 +45,7 @@
def _add_api_output_arguments(parser: argparse.ArgumentParser) -> None:
group = parser.add_argument_group('Output arguments')
group.add_argument('--format', default='jsonv2',
choices=['xml', 'json', 'jsonv2', 'geojson', 'geocodejson', 'debug'],
choices=formatting.list_formats(napi.SearchResults) + ['debug'],
help='Format of result')
for name, desc in EXTRADATA_PARAMS:
group.add_argument('--' + name, action='store_true', help=desc)
Expand Down

0 comments on commit 1a0f851

Please sign in to comment.