latex bot discord
Diffstat (limited to 'autoloads/CLI.gd')
| -rw-r--r-- | autoloads/CLI.gd | 11 |
1 files changed, 11 insertions, 0 deletions
diff --git a/autoloads/CLI.gd b/autoloads/CLI.gd new file mode 100644 index 0000000..095bfd3 --- /dev/null +++ b/autoloads/CLI.gd @@ -0,0 +1,11 @@ +extends Node + +func _ready() -> void: + var p := Parser.new() + p.add_argument(Arg.new({triggers=["-h", "--help", "-?"], help="show this help message and exit", action="store_true"})) + var args = p.parse_arguments() + if args == null: + get_tree().quit() + elif args.get("help", false): + print(p.help()) + get_tree().quit()
\ No newline at end of file |