from typing import Callable
from rads.color import green, red, bold
def err_exit(*args, file=sys.stderr, rcode=1, **kwargs):
color_print(*args, color=red, file=file, **kwargs)
def warn(*args, file=sys.stderr, color: Callable = red, **kwargs):
color_print(*args, color=color, file=file, **kwargs)
def print_listed(ipaddr: netaddr.IPAddress, listed: bool, where: str):
"""For printing whether an IP is listed in iptables"""
red('is listed') if listed else green('is not listed'),
def header(*args, color: Callable = bold, **kwargs):
color_print(*args, color=color, **kwargs)
def color_print(*args, color: Callable = red, **kwargs):