feat(app): limit scope of notes with one or more filters (#13)

* style: rename `VaultMetadata.add_metadata` to `VaultMetadata.index_metadata`

* refactor(vault): refactor filtering notes

* fix(application): improve usage display

* fix(application): improve colors of questions

* feat(application): limit the scope of notes to be processed with one or more filters

* build(deps): update identify
This commit is contained in:
Nathaniel Landau
2023-02-01 15:00:57 -05:00
committed by GitHub
parent 6909738218
commit 4a29945de2
15 changed files with 418 additions and 171 deletions

View File

@@ -1,6 +1,7 @@
"""Logging and alerts."""
import sys
from pathlib import Path
from textwrap import wrap
import rich.repr
import typer
@@ -62,6 +63,29 @@ def info(msg: str) -> None:
print(f"INFO | {msg}")
def usage(msg: str, width: int = 80) -> None:
"""Print a usage message without using logging.
Args:
msg: Message to print
width (optional): Width of the message
"""
for _n, line in enumerate(wrap(msg, width=width)):
if _n == 0:
print(f"[dim]USAGE | {line}")
else:
print(f"[dim] | {line}")
def debug(msg: str) -> None:
"""Print a debug message without using logging.
Args:
msg: Message to print
"""
print(f"[blue]DEBUG | {msg}[/blue]")
def dim(msg: str) -> None:
"""Print a message in dimmed color.