mirror of
https://github.com/rr-/pq-cli.git
synced 2026-09-29 06:44:00 -06:00
misc: add undocumented --no-save option
This commit is contained in:
@@ -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()
|
||||
|
||||
|
||||
|
||||
@@ -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)
|
||||
|
||||
Reference in New Issue
Block a user