# +==== BEGIN polyguard =================+
# LOGO:
# input
#
# @#$%! hello
# | |
# +--+--+
# |
# v
# +------------+
# | POLY GUARD |
# +------------+
# | |
# v v
# BLOCKED PASSED
# KO OK
# /STOP
# PROJECT: polyguard
# FILE: cli.py
# CREATION DATE: 21-03-2026
# LAST Modified: 19:47:9 21-03-2026
# DESCRIPTION:
# A module that provides a set of swearwords to listen to when filtering while allowing to toggle on and off different languages.
# /STOP
# COPYRIGHT: (c) Henry Letellier
# PURPOSE: This is the code in charge of simulating a pseudo tty for the ones that start the module without piping content into it.
# TTY-friendly CLI wrapper for PolyGuard.
#
# Provides a simple entrypoint that accepts a path to the DB and a test
# word to check. The CLI is intentionally minimal to be easy to extend.
# // AR
# +==== END polyguard =================+
| int polyguard.src.cli.main |
( |
Optional[List[str]] | argv = None | ) |
|
CLI entrypoint for PolyGuard.
Dispatches to single-word check, stdin batch processing, or interactive
REPL based on arguments and whether stdin is a TTY.
Args:
argv: Optional list of command-line arguments. If None, uses sys.argv.
Returns:
int: Exit code (0 for success, non-zero for error).
Definition at line 411 of file cli.py.