diff options
author | Jesusaves <cpntb1@ymail.com> | 2021-05-19 15:37:28 -0300 |
---|---|---|
committer | Jesusaves <cpntb1@ymail.com> | 2021-05-19 15:37:28 -0300 |
commit | 9ad462931cee68b915d9c40fd3cd20932cf18cee (patch) | |
tree | 16cd5e9de4aacb100fd69cff649a4b42395c0d26 | |
parent | d5fd679b14ec579e103b797dc16696430804ac1e (diff) | |
download | renpy-9ad462931cee68b915d9c40fd3cd20932cf18cee.tar.gz renpy-9ad462931cee68b915d9c40fd3cd20932cf18cee.tar.bz2 renpy-9ad462931cee68b915d9c40fd3cd20932cf18cee.tar.xz renpy-9ad462931cee68b915d9c40fd3cd20932cf18cee.zip |
Rewrite command-line parser.
-rw-r--r-- | game/core.rpy | 34 |
1 files changed, 24 insertions, 10 deletions
diff --git a/game/core.rpy b/game/core.rpy index 928189e..77724d8 100644 --- a/game/core.rpy +++ b/game/core.rpy @@ -220,19 +220,33 @@ init -4 python: ## Debug information if config.developer: - print("PARSEC") print("Args: %s" % str(args)) ## Command Line Defaults - if ("steam" in args): - print("Steam Mode Enabled") - persistent.steam = True - if ("dummy" in args): - print("Dummy Mode Enabled") - USE_DUMMY_DATA = True - if ("launch" in args): - print("Auto-launch mode Enabled") - AUTOLAUNCH = True + for cmd in args: + if (cmd == "steam"): + print("Steam Mode Enabled") + persistent.steam = True + if (cmd == "dummy"): + print("Dummy Mode Enabled") + USE_DUMMY_DATA = True + if (cmd == "launch"): + print("Auto-launch mode Enabled") + AUTOLAUNCH = True + if (cmd == "version"): + print("%s %s v%s" % (config.name, "Mirror Lake", config.version)) + renpy.quit() + if (cmd == "help"): + print("=========================================================") + print("Commands:") + print("steam - Enables Steam login") + print("dummy - do not login, use a dummy data for testing") + print("launch - skip main menu screen") + print("version - shows the program version and exits") + print("help - shows this help screen and exits") + print("") + print("Last commands have precedence over earlier ones.") + renpy.quit() return True renpy.arguments.register_command('adv', parse_command) |