mirror of
https://github.com/osm-search/Nominatim.git
synced 2026-02-16 15:47:58 +00:00
introduce custom object for cmdline arguments
Allows to define special functions over the arguments. Also splits CLI tests in two files as they have become too many.
This commit is contained in:
@@ -12,6 +12,7 @@ from .config import Configuration
|
||||
from .tools.exec_utils import run_legacy_script, run_php_server
|
||||
from .errors import UsageError
|
||||
from . import clicmd
|
||||
from .clicmd.args import NominatimArgs
|
||||
|
||||
LOG = logging.getLogger()
|
||||
|
||||
@@ -62,7 +63,8 @@ class CommandlineParser:
|
||||
""" Parse the command line arguments of the program and execute the
|
||||
appropriate subcommand.
|
||||
"""
|
||||
args = self.parser.parse_args(args=kwargs.get('cli_args'))
|
||||
args = NominatimArgs()
|
||||
self.parser.parse_args(args=kwargs.get('cli_args'), namespace=args)
|
||||
|
||||
if args.subcommand is None:
|
||||
self.parser.print_help()
|
||||
|
||||
Reference in New Issue
Block a user