Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat: add cli argument to display runner version #21

Merged
merged 3 commits into from
Dec 4, 2023
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 7 additions & 0 deletions src/safeds_runner/server/main.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@
import argparse
import json
import logging
from importlib.metadata import version

import flask.app
import flask_sock
Expand Down Expand Up @@ -178,6 +179,12 @@ def main() -> None: # pragma: no cover

parser = argparse.ArgumentParser(description="Start Safe-DS Runner on a specific port.")
parser.add_argument("--port", type=int, default=5000, help="Port on which to run the python server.")
parser.add_argument(
"-V",
"--version",
action="version",
version="%(prog)s {version}".format(version=version("safe-ds-runner")),
)
args = parser.parse_args()
logging.info("Starting Safe-DS Runner on port %s", str(args.port))
# Only bind to host=127.0.0.1. Connections from other devices should not be accepted
Expand Down