#!/usr/bin/python3 # "PlacehoLder Un- and Generator" import sys import re from enum import Enum, auto C = {} # ANSI colors def has_color(): import os return "color" in os.environ.get('TERM') def def_colors(): global C C = { 'b': '\033[34m', 'y': '\033[33m', 'g': '\033[32m', 'r': '\033[31m', 'm': '\033[35m', 'B': '\033[1m', 'R': '\033[7m', 'n': '\033[0m', } def undef_colors(): global C C = { 'b': '', 'y': '', 'g': '', 'r': '', 'B': '', 'n': '', 'R': '', 'm': '', } undef_colors() class Error(Enum): PARAM_MISS = auto() UNK_FLAG = auto() IO = auto() UNK_OPT = auto() UNTERM_DEF = auto() NO_FILES = auto() MULTI_OP = auto() NO_OP = auto() def usage(): print( '''{C[g]}{C[B]}{argv0}{C[n]} {C[B]}{C[y]}({C[b]}-g{C[y]}|{C[b]}-u{C[y]}) {C[B]}{C[y]}({C[b]}