diff options
author | David Lord <davidism@gmail.com> | 2022-04-28 11:05:06 -0700 |
---|---|---|
committer | David Lord <davidism@gmail.com> | 2022-04-28 11:05:06 -0700 |
commit | 501dec6e4324f289eee598a77865a6de95b62727 (patch) | |
tree | c62c4007aa83f9623f9cdc99be2097a5aef3cd4a /src/click/exceptions.py | |
parent | 0aec1168ac591e159baf6f61026d6ae322c53aaf (diff) | |
download | click-parser-rewrite.tar.gz |
workparser-rewrite
Diffstat (limited to 'src/click/exceptions.py')
-rw-r--r-- | src/click/exceptions.py | 8 |
1 files changed, 8 insertions, 0 deletions
diff --git a/src/click/exceptions.py b/src/click/exceptions.py index 9e20b3e..dfa4fa3 100644 --- a/src/click/exceptions.py +++ b/src/click/exceptions.py @@ -253,6 +253,14 @@ class BadArgumentUsage(UsageError): """ +class NoArgsIsHelpError(UsageError): + def __init__(self, ctx): + super().__init__(ctx.get_help(), ctx=ctx) + + def show(self, file=None): + echo(self.format_message(), file=file, err=True, color=self.ctx.color) + + class FileError(ClickException): """Raised if a file cannot be opened.""" |