better help text output

This commit is contained in:
Nick Sweeting 2024-10-02 19:46:31 -07:00
parent 968adf64da
commit 035a14b6ea
No known key found for this signature in database
9 changed files with 206 additions and 131 deletions

View file

@ -5,14 +5,25 @@ __package__ = 'archivebox.misc'
import sys
from typing import Optional, Union, Tuple, List
from collections import defaultdict
from random import randint
from benedict import benedict
from rich.console import Console
from rich.highlighter import Highlighter
# SETUP RICH CONSOLE / TTY detection / COLOR / PROGRESS BARS
CONSOLE = Console()
IS_TTY = CONSOLE.is_interactive
class RainbowHighlighter(Highlighter):
def highlight(self, text):
for index in range(len(text)):
text.stylize(f"color({randint(90, 98)})", index, index + 1)
rainbow = RainbowHighlighter()
DEFAULT_CLI_COLORS = benedict(
{
"reset": "\033[00;00m",