mirror of
https://git.nolog.cz/NoLog.cz/nginx-configurator.git
synced 2025-01-31 20:03:34 +01:00
14 lines
343 B
Python
14 lines
343 B
Python
|
import click
|
||
|
import sys
|
||
|
|
||
|
|
||
|
class NccException(click.ClickException):
|
||
|
def __init__(self, *args, log=None):
|
||
|
super().__init__(*args)
|
||
|
self.log = log
|
||
|
|
||
|
def show(self, file=None) -> None:
|
||
|
if self.log:
|
||
|
click.echo(self.log)
|
||
|
click.secho("ERROR: " + self.format_message(), file or sys.stderr, fg="red")
|