Files
redmine/fix_globals.py
T
Jason Thistlethwaite 9ee9eb3ec6 Organized
2026-10-17 20:50:35 -04:00

20 lines
740 B
Python

#!/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")