mirror of
https://github.com/rr-/pq-cli.git
synced 2026-09-29 06:44:00 -06:00
ui: add --no-config
This commit is contained in:
+10
-1
@@ -11,7 +11,16 @@ SAVE_PATH = Path(xdg.XDG_CONFIG_HOME) / "pqcli" / "save.dat"
|
|||||||
|
|
||||||
def parse_args() -> argparse.Namespace:
|
def parse_args() -> argparse.Namespace:
|
||||||
parser = argparse.ArgumentParser(prog="pqcli")
|
parser = argparse.ArgumentParser(prog="pqcli")
|
||||||
parser.add_argument("--cheats", help="???", action="store_true")
|
parser.add_argument(
|
||||||
|
"--no-config",
|
||||||
|
dest="use_config",
|
||||||
|
action="store_false",
|
||||||
|
help=(
|
||||||
|
"Don't load or save configuration files from $XDG_CONFIG_HOME "
|
||||||
|
"(player data will still be saved)"
|
||||||
|
),
|
||||||
|
)
|
||||||
|
parser.add_argument("--cheats", action="store_true", help="???")
|
||||||
return parser.parse_args()
|
return parser.parse_args()
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
@@ -70,6 +70,8 @@ def bind_commands() -> None:
|
|||||||
class Ui:
|
class Ui:
|
||||||
def __init__(self, roster: Roster, args: argparse.Namespace) -> None:
|
def __init__(self, roster: Roster, args: argparse.Namespace) -> None:
|
||||||
bind_commands()
|
bind_commands()
|
||||||
|
|
||||||
|
if args.use_config:
|
||||||
if not load_palette():
|
if not load_palette():
|
||||||
save_palette() # create a file for the user to edit
|
save_palette() # create a file for the user to edit
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user