dockge-cli/dockge_cli/components/parser.py
Firq 537a0d8015
All checks were successful
/ backend-pylint (push) Successful in 11s
/ build-artifacts (push) Successful in 10s
/ publish-artifacts (push) Successful in 8s
Rewrote using command factory
2024-07-03 20:36:22 +02:00

19 lines
633 B
Python

import argparse
import sys
from .. import __version__
from ..models.parser import Arguments
from .bindings import binds
def parse_arguments():
parser = argparse.ArgumentParser(
prog="dockge_cli",
description="CLI interface for interacting with Dockge",)
parser.add_argument("command", choices=list(binds.keys()), 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)
return args, extra_args