From 427daa7f1a2ef21389843c645fe281b660c4e17a Mon Sep 17 00:00:00 2001 From: Marco D'Aleo Date: Thu, 24 Sep 2026 17:20:46 +0100 Subject: [PATCH] Initial release 0.0.1 --- poetry.lock | 7 +++++++ pyproject.toml | 9 +++++---- src/schedls/__init__.py | 0 src/schedls/cli.py | 35 +++++++++++++++++++++++++++++++++++ 4 files changed, 47 insertions(+), 4 deletions(-) create mode 100644 poetry.lock create mode 100644 src/schedls/__init__.py create mode 100644 src/schedls/cli.py diff --git a/poetry.lock b/poetry.lock new file mode 100644 index 0000000..f930611 --- /dev/null +++ b/poetry.lock @@ -0,0 +1,7 @@ +# This file is automatically @generated by Poetry 2.4.1 and should not be changed by hand. +package = [] + +[metadata] +lock-version = "2.1" +python-versions = ">=3.10,<4.0" +content-hash = "7b8fc01b274bd807fb00372bbc8e138330f15ae7978ed61e180f3b17ec076725" diff --git a/pyproject.toml b/pyproject.toml index ca66b4b..0004308 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -1,16 +1,17 @@ [project] name = "schedls" version = "0.0.1" -description = "" +description = "Inspect and manage Linux scheduled jobs" authors = [ - {name = "Marco D'Aleo",email = "marco@marcodaleo.com"} + { name = "Marco D'Aleo", email = "marco@marcodaleo.com" } ] license = "GPL-3.0-or-later" readme = "README.md" requires-python = ">=3.10,<4.0" -dependencies = [ -] +dependencies = [] +[project.scripts] +schedls = "schedls.cli:main" [build-system] requires = ["poetry-core>=2.0.0,<3.0.0"] diff --git a/src/schedls/__init__.py b/src/schedls/__init__.py new file mode 100644 index 0000000..e69de29 diff --git a/src/schedls/cli.py b/src/schedls/cli.py new file mode 100644 index 0000000..27f1637 --- /dev/null +++ b/src/schedls/cli.py @@ -0,0 +1,35 @@ +import argparse +import subprocess + + +def main() -> int: + parser = argparse.ArgumentParser( + prog="schedls", + description="Inspect and manage Linux scheduled jobs.", + ) + + parser.add_argument( + "--version", + action="version", + version="schedls 0.0.1", + ) + + subparsers = parser.add_subparsers(dest="command") + + calendar = subparsers.add_parser( + "calendar", + help="Validate and inspect a systemd calendar expression", + ) + calendar.add_argument("expression") + + args = parser.parse_args() + + if args.command == "calendar": + result = subprocess.run( + ["systemd-analyze", "calendar", args.expression], + check=False, + ) + return result.returncode + + parser.print_help() + return 0