Add a simple cat (path handling still needed)

This commit is contained in:
Andrew Mulbrook 2026-03-26 00:48:53 -05:00
parent ffefe4dd21
commit 01e9780bb8

22
trovedb/cli/cat.py Normal file
View file

@ -0,0 +1,22 @@
"""Note List"""
import argparse
import sys
from trovedb.cli import CliEnv
def setup(parser: argparse.ArgumentParser) -> None:
"""Configure this subcommand's arguments."""
parser.add_argument('-u', '--unbuffered', action='store_true',
help="Output raw bytes, without any decoding.")
parser.add_argument('notes', nargs='+', metavar='FILENAME',
help="One or more notes to process.")
def run(env: CliEnv, args: argparse.Namespace) -> None:
"""Entry point when this subcommand is invoked."""
# TODO: Resolve path!
for note in args.notes:
sys.stdout.buffer.write(env.local_trove.get_root().child(note).read_content())