From c930d6bf6ab9227d23a66ccc5be34fa7c7960ba4 Mon Sep 17 00:00:00 2001 From: Min RK Date: Fri, 2 Jun 2023 13:21:53 +0200 Subject: [PATCH] Abort informatively on unrecognized CLI options rather than ignoring them, leading to unexpected behavior --- jupyterhub/app.py | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/jupyterhub/app.py b/jupyterhub/app.py index 29822429..3a5e3371 100644 --- a/jupyterhub/app.py +++ b/jupyterhub/app.py @@ -9,6 +9,7 @@ import logging import os import re import secrets +import shlex import signal import socket import ssl @@ -2840,6 +2841,10 @@ class JupyterHub(Application): super().initialize(*args, **kwargs) if self.generate_config or self.generate_certs or self.subapp: return + if self.extra_args: + self.exit( + f"Unrecognized command-line arguments: {' '.join(shlex.quote(arg) for arg in self.extra_args)!r}" + ) self._start_future = asyncio.Future() def record_start(f):