pi_wake_agent.py: Add --dry-run flag
- --dry-run shows what would be done without executing - Logs intended actions to log file - Exits 0 without modifying crontab or sending wake messages
This commit is contained in:
@@ -382,6 +382,7 @@ EXAMPLES:
|
||||
parser.add_argument("--sessions", help="Comma-separated list of sessions")
|
||||
parser.add_argument("--msg", default=f"Operator says CONTINUE. {AGENT_NICK} here, saying hi!", help="Wake message")
|
||||
parser.add_argument("--debug", action="store_true", help="Enable debug logging")
|
||||
parser.add_argument("--dry-run", action="store_true", help="Show what would be done without executing")
|
||||
parser.set_defaults(mode="install")
|
||||
return parser
|
||||
|
||||
@@ -417,6 +418,12 @@ def main() -> int:
|
||||
logger.info(f"Message: {args.msg}")
|
||||
if args.mode == "succession":
|
||||
logger.info(f"Count: {args.count}")
|
||||
if args.dry_run:
|
||||
logger.info("DRY RUN: no actions will be executed")
|
||||
|
||||
if args.dry_run:
|
||||
logger.info("DRY RUN: would execute mode '%s' with sessions=%s, interval=%s, message='%s'", args.mode, sessions, args.interval, args.msg)
|
||||
return 0
|
||||
|
||||
try:
|
||||
if args.mode == "install":
|
||||
|
||||
Reference in New Issue
Block a user