From a3f34d77171bcef2b04f89ec910b2716ee1c5804 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=C3=96zcan=20Yar=C4=B1md=C3=BCnya?= Date: Wed, 1 Feb 2023 16:05:04 +0300 Subject: [PATCH] Updated to v0.1.3 --- argparge/__init__.py | 6 ++---- docs/index.md | 2 +- pyproject.toml | 2 +- 3 files changed, 4 insertions(+), 6 deletions(-) diff --git a/argparge/__init__.py b/argparge/__init__.py index 1441bae..f2fb829 100644 --- a/argparge/__init__.py +++ b/argparge/__init__.py @@ -23,14 +23,12 @@ class Command(argparse.ArgumentParser): def __init__(self, *commands, **kwargs): self._commands = list(commands) - assert self.name is not None, "Command name cannot be empty! Set 'name' variable {} class.".format( - self.__class__.__name__ - ) + self.name = self.name or self.__class__.__name__.rstrip("Command").lower() self.help = self.help or self.name self.kwargs = kwargs self.kwargs["description"] = kwargs.get("description", self.help) self.kwargs["formatter_class"] = kwargs.get("formatter_class", HelpFormatter) - super().__init__(**kwargs) + super().__init__(**self.kwargs) @abstractmethod def add_arguments(self, parser: "Command"): ... diff --git a/docs/index.md b/docs/index.md index b59bfe1..0b2cba8 100644 --- a/docs/index.md +++ b/docs/index.md @@ -8,7 +8,7 @@ | Documentation | https://ozcanyarimdunya.github.io/argparge/ | | Source code | https://github.com/ozcanyarimdunya/argparge/ | -`argparge` is a library that you can create beautiful class based cli application by using `argparse`. +`argparge` is a library that you can create beautiful class based cli application. ## Installation diff --git a/pyproject.toml b/pyproject.toml index 3c30c7c..6cd7d17 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -1,6 +1,6 @@ [tool.poetry] name = "argparge" -version = "0.1.2" +version = "0.1.3" description = "A very simple tool to create beautiful console application by using native argparse." authors = ["Özcan Yarımdünya "] license = "MIT"