22 lines
549 B
Python
22 lines
549 B
Python
import sys
|
|
|
|
class Colors:
|
|
RESET = "\033[0m"
|
|
RED = "\033[31m"
|
|
GREEN = "\033[32m"
|
|
YELLOW = "\033[33m"
|
|
BLUE = "\033[34m"
|
|
MAGENTA = "\033[35m"
|
|
CYAN = "\033[36m"
|
|
WHITE = "\033[37m"
|
|
|
|
class BaseCli:
|
|
def info(self, message):
|
|
print(f'[{Colors.GREEN}INFO{Colors.RESET}] {message}')
|
|
|
|
def warning(self, message):
|
|
print(f'[{Colors.YELLOW}WARNING{Colors.RESET}] {message}')
|
|
|
|
def error(self, message, exit_code=1):
|
|
print(f'[{Colors.RED}ERROR{Colors.RESET}] {message}')
|
|
sys.exit(exit_code) |