diff --git a/news/cli.py b/news/cli.py index a573abf..c62bd0e 100644 --- a/news/cli.py +++ b/news/cli.py @@ -260,6 +260,14 @@ def cmd_digest(args) -> int: ntfy = NtfyConfig.from_env() base = ntfy.api_base or "" link = f"{base}/digest/{day}" + if args.no_push and not args.dry_run: + # Rebuild today's digest in place after a settings change, without + # sending a second pointer for a day already pushed. Deliberately + # the same code path as the scheduled run rather than a script + # beside it: a tuning path that diverges from the production path + # is what made the old system's replay harness worthless. + print(f"digest rebuilt, not pushed -> {link}") + return 0 if args.dry_run: print(f"[dry-run] push: {title}\n{body}\n-> {link}") for i in items[:8]: @@ -308,6 +316,8 @@ def main(argv: list[str] | None = None) -> int: p = sub.add_parser("digest", help="build the digest and push a pointer to it") p.add_argument("--dry-run", action="store_true") + p.add_argument("--no-push", action="store_true", + help="rebuild the digest and its prose without sending ntfy") p.set_defaults(fn=cmd_digest) p = sub.add_parser("serve", help="run the web server")