34 lines
789 B
Python
34 lines
789 B
Python
"""Local dev CLI for the CM bot. Mirrors Telegram /1, /2, /3 plus
|
|
operational commands. No-arg invocation drops into a stdlib TUI menu.
|
|
"""
|
|
|
|
import argparse
|
|
import sys
|
|
|
|
from .cm_bot_hal import CM_BOT_HAL
|
|
|
|
|
|
def cmd_interactive(_args):
|
|
raise NotImplementedError("cmd_interactive is implemented in a later task")
|
|
|
|
|
|
def build_parser() -> argparse.ArgumentParser:
|
|
p = argparse.ArgumentParser(
|
|
prog="bot_cli",
|
|
description="CM Bot dev CLI (mirrors Telegram triggers).",
|
|
)
|
|
p.add_subparsers(dest="command")
|
|
return p
|
|
|
|
|
|
def main(argv=None) -> int:
|
|
parser = build_parser()
|
|
args = parser.parse_args(argv)
|
|
if args.command is None:
|
|
return cmd_interactive(args) or 0
|
|
return args.func(args) or 0
|
|
|
|
|
|
if __name__ == "__main__":
|
|
sys.exit(main())
|