From cbc05199a40b711d62cda74b566982762015f5e8 Mon Sep 17 00:00:00 2001 From: Joshua Hoblitt Date: Fri, 6 Sep 2024 09:59:39 -0700 Subject: [PATCH] install client as s3nd --- pyproject.toml | 1 + python/s3daemon/send.py | 11 ++++++++++- 2 files changed, 11 insertions(+), 1 deletion(-) diff --git a/pyproject.toml b/pyproject.toml index 808b3a6..8140d72 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -8,6 +8,7 @@ build-backend = "setuptools.build_meta" [project.scripts] s3daemon = "s3daemon.s3daemon:main" +s3nd = "s3daemon.send:main" [tool.setuptools_scm] diff --git a/python/s3daemon/send.py b/python/s3daemon/send.py index 05c06d6..3a410d2 100644 --- a/python/s3daemon/send.py +++ b/python/s3daemon/send.py @@ -50,5 +50,14 @@ def send(filename, dest): sys.exit(1) -if __name__ == "__main__": +def main(): + """CLI entry point.""" + if len(sys.argv) != 3: + print(f"Usage: {sys.argv[0]} filename dest", file=sys.stderr) + sys.exit(1) + send(sys.argv[1], sys.argv[2]) + + +if __name__ == "__main__": + main()