summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJesusaves <cpntb1@ymail.com>2021-05-08 22:05:03 -0300
committerJesusaves <cpntb1@ymail.com>2021-05-08 22:05:03 -0300
commit943b38708959733f5e10802eb77924efebd85869 (patch)
tree1fa08e4bfa9987b7b8abe7b8dda37a6cf9f63e5f
parentf1c2e196f97bf3d20be327964e0854b9cc453e32 (diff)
downloadrenpy-943b38708959733f5e10802eb77924efebd85869.tar.gz
renpy-943b38708959733f5e10802eb77924efebd85869.tar.bz2
renpy-943b38708959733f5e10802eb77924efebd85869.tar.xz
renpy-943b38708959733f5e10802eb77924efebd85869.zip
Prototype which allows command-line arguments.
Probably won't use it, though. However it is safer to have it in.
-rw-r--r--game/discord.rpy16
1 files changed, 16 insertions, 0 deletions
diff --git a/game/discord.rpy b/game/discord.rpy
index a15a301..6b1f14c 100644
--- a/game/discord.rpy
+++ b/game/discord.rpy
@@ -71,3 +71,19 @@ label quit:
$ stdout("Thanks for playing the Mana Launcher.")
return
+init -4 python:
+ def parse_command():
+ parser = renpy.arguments.ArgumentParser()
+
+ parser.add_argument('args', nargs='+', help="Command-line arguments.")
+ args = parser.parse_args()
+
+ # Do something with args.args
+ print("PARSEC")
+ print("%s" % str(args))
+ print("Args: %s" % str(args.args))
+
+ return True
+
+ renpy.arguments.register_command('parse', parse_command)
+