diff options
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.""" |