Skip to content

Commit

Permalink
Merge pull request #10 from angrybayblade/release/v0.1.0.rc2
Browse files Browse the repository at this point in the history
Release v0.1.0.rc2
  • Loading branch information
angrybayblade authored Aug 12, 2023
2 parents 0bf4e3f + cd93a3c commit 87abefd
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 4 deletions.
4 changes: 4 additions & 0 deletions HISTORY.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,7 @@
# v0.1.0.rc2

- Early exit on `--version` flag

# v0.1.0.rc1

- Adds support for `--version` flag
Expand Down
9 changes: 5 additions & 4 deletions clea/wrappers.py
Original file line number Diff line number Diff line change
Expand Up @@ -409,6 +409,11 @@ def invoke(self, argv: Argv, isolated: bool = False) -> int:
args, kwargs, help_only, version_only, sub_command, sub_argv = t.cast(
GroupParser, self._parser
).parse(argv=argv, commands=self._children)

if version_only:
print(self.version)
return 0

if sub_command is not None:
self._invoke(
args=args, kwargs=kwargs, isolated=isolated, help_only=help_only
Expand All @@ -420,10 +425,6 @@ def invoke(self, argv: Argv, isolated: bool = False) -> int:
args=args, kwargs=kwargs, isolated=isolated, help_only=help_only
)

if version_only:
print(self.version)
return 0

return self.help()

def help(self) -> int:
Expand Down

0 comments on commit 87abefd

Please sign in to comment.