misc: add undocumented --no-save option

This commit is contained in:
rr-
2018-11-08 13:09:37 +01:00
parent 86f59d8fb2
commit 066fc692e4
2 changed files with 10 additions and 2 deletions
+7
View File
@@ -20,6 +20,12 @@ def parse_args() -> argparse.Namespace:
"(player data will still be saved)"
),
)
parser.add_argument(
"--no-save",
dest="use_saves",
action="store_false",
help=argparse.SUPPRESS,
)
parser.add_argument("--cheats", action="store_true", help="???")
return parser.parse_args()
@@ -31,6 +37,7 @@ def main() -> None:
try:
Ui(roster, args).run()
finally:
if args.use_saves:
roster.save()
+1
View File
@@ -164,5 +164,6 @@ class Ui:
self.loop.set_alarm_in(TICK_FREQ, self.on_tick)
def on_save(self, _loop: urwid.MainLoop, _user_data: T.Any) -> None:
if self.args.use_saves:
self.roster.save()
self.loop.set_alarm_in(SAVE_FREQ, self.on_save)