Skip to content

armgit / zulip

Public Imported from GitHub
0

Zulip server and web application. Open-source team chat that helps teams stay productive and focused.

stop-server: Accept --help and reject unknown args.

Aman Agrawal8b2d94fba922
diff --git a/scripts/stop-server b/scripts/stop-server
index 2f5e3daaeaa..0c3cd3c4833 100755
--- a/scripts/stop-server
+++ b/scripts/stop-server
@@ -1,4 +1,5 @@
#!/usr/bin/env python3
+import argparse
import logging
import os
import pwd
@@ -21,6 +22,12 @@ from scripts.lib.zulip_tools import (
su_to_zulip,
)
+# Parse arguments before any side effects, so `--help` prints usage
+# instead of stopping the server.
+argparse.ArgumentParser(
+ description="Stop the Zulip server (Django, Tornado and workers).",
+).parse_args()
+
deploy_path = os.path.realpath(os.path.join(os.path.dirname(__file__), ".."))
os.chdir(deploy_path)