#!/usr/bin/env python3 """Fix global flag placement for subcommands like tui.""" with open("redmine_tickets.py") as f: txt = f.read() # 1. Add --allow-prod-writes to the parent value options old_parent = '_PARENT_VALUE_OPTIONS = frozenset({"--base-url", "--project", "--cache-dir", "--config"})' new_parent = '_PARENT_VALUE_OPTIONS = frozenset({"--base-url", "--project", "--cache-dir", "--config", "--allow-prod-writes"})' if old_parent in txt: txt = txt.replace(old_parent, new_parent) print("1. Updated _PARENT_VALUE_OPTIONS to include --allow-prod-writes") else: print("1. PARENT set change skipped (not exact match)") with open("redmine_tickets.py", "w") as f: f.write(txt) print("Saved parent options update")