mirror of
https://github.com/ArchiveBox/ArchiveBox.git
synced 2026-04-06 15:57:53 +10:00
better help text output
This commit is contained in:
@@ -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",
|
||||
|
||||
Reference in New Issue
Block a user