Initial release 0.0.1
This commit is contained in:
Generated
+7
@@ -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"
|
||||
+5
-4
@@ -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"]
|
||||
|
||||
@@ -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
|
||||
Reference in New Issue
Block a user