mirror of
https://github.com/ArchiveBox/ArchiveBox.git
synced 2025-05-15 07:34:27 -04:00
better help text output
This commit is contained in:
parent
968adf64da
commit
035a14b6ea
9 changed files with 206 additions and 131 deletions
|
@ -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",
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue