dockge-cli/dockge_cli/components/parser.py
Firq 44ee9c7cad
All checks were successful
/ backend-pylint (push) Successful in 9s
Starting with CLI
2024-06-29 17:41:09 +02:00

29 lines
641 B
Python

import argparse
import sys
from .. import __version__
commands = [
"host",
"login",
"logout",
"list",
"restart",
"update",
"exit"
]
class Arguments(argparse.Namespace):
command: str
parser = argparse.ArgumentParser(
prog="dockge_cli",
description="CLI interface for interacting with Dockge",)
parser.add_argument("command", choices=commands, action="store", type=str, default=None)
parser.add_argument("--version", action="version", version=f"dockge_cli {__version__}")
args = Arguments()
args, extra_args = parser.parse_known_args(sys.argv[1:], namespace=args)