add a function to return a formatted version

Replaces the various repeated format strings throughout the code.
This commit is contained in:
Sarah Hoffmann
2022-05-10 23:00:18 +02:00
parent 5ff35d9984
commit 4e1e166c6a
7 changed files with 24 additions and 19 deletions

View File

@@ -60,9 +60,9 @@ class CommandlineParser:
def nominatim_version_text():
""" Program name and version number as string
"""
text = 'Nominatim version %s.%s.%s.%s' % version.NOMINATIM_VERSION
text = f'Nominatim version {version.version_str()}'
if version.GIT_COMMIT_HASH is not None:
text += ' (%s)' % version.GIT_COMMIT_HASH
text += f' ({version.GIT_COMMIT_HASH})'
return text
def add_subcommand(self, name, cmd):