mirror of
https://github.com/rr-/pq-cli.git
synced 2026-09-28 22:33:59 -06:00
ui: add cheats
This commit is contained in:
+9
-1
@@ -1,3 +1,4 @@
|
||||
import argparse
|
||||
from pathlib import Path
|
||||
|
||||
import xdg
|
||||
@@ -8,11 +9,18 @@ from pqcli.ui import Ui
|
||||
SAVE_PATH = Path(xdg.XDG_CONFIG_HOME) / "pqcli" / "save.dat"
|
||||
|
||||
|
||||
def parse_args() -> argparse.Namespace:
|
||||
parser = argparse.ArgumentParser(prog="pqcli")
|
||||
parser.add_argument("--cheats", help="enable cheats", action="store_true")
|
||||
return parser.parse_args()
|
||||
|
||||
|
||||
def main() -> None:
|
||||
args = parse_args()
|
||||
roster = Roster.load(SAVE_PATH)
|
||||
|
||||
try:
|
||||
Ui(roster).run()
|
||||
Ui(roster, args).run()
|
||||
finally:
|
||||
roster.save(SAVE_PATH)
|
||||
|
||||
|
||||
Reference in New Issue
Block a user