From 09c958bb616d77588c35d94f00e188f94c84fa4c Mon Sep 17 00:00:00 2001 From: VAN BOSSUYT Nicolas Date: Sat, 12 Oct 2024 10:47:56 +0200 Subject: [PATCH] Fixed help, and usage subcommands not working if the subcommand didn't had any arguments. --- cutekit/cli.py | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/cutekit/cli.py b/cutekit/cli.py index c79428b..3d0f0ba 100644 --- a/cutekit/cli.py +++ b/cutekit/cli.py @@ -770,6 +770,10 @@ def parse(self, args: list[str]) -> Any: return res +class NoArgs: + pass + + @dt.dataclass class Command: """ @@ -887,6 +891,7 @@ def invoke(self, argv: list[str]): args = self.schema.parse(argv) self.callable(args) else: + Schema.extract(NoArgs).parse(argv) self.callable() def eval(self, args: list[str]):