feat(cli): add cache command to manage your fastanime cache dir

This commit is contained in:
Benex254
2024-08-07 16:35:14 +03:00
parent 71623c654a
commit 1afa7aa09b
3 changed files with 44 additions and 0 deletions

View File

@@ -22,6 +22,14 @@ BG_GREEN = "\033[48;2;120;233;12;m"
GREEN = "\033[38;2;45;24;45;m"
def sizeof_fmt(num, suffix="B"):
for unit in ("", "K", "M", "G", "T", "P", "E", "Z"):
if abs(num) < 1024.0:
return f"{num:3.1f}{unit}{suffix}"
num /= 1024.0
return f"{num:.1f}Yi{suffix}"
def get_true_fg(string: str, r: int, g: int, b: int, bold=True) -> str:
if bold:
return f"{BOLD}\033[38;2;{r};{g};{b};m{string}{RESET}"