-
Notifications
You must be signed in to change notification settings - Fork 10
/
main.py
55 lines (50 loc) · 1.88 KB
/
main.py
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
#Modules
import sys
sys.path.insert(1, 'modules')
import argparse
import time
import launch
import config
import subprocess
import os
# Working Directory
try:
os.mkdir(os.environ['APPDATA']+"\\LCLPy")
except:
pass
os.chdir(os.environ['APPDATA']+"\\LCLPy")
#Checks if Options.ini exists or not.
config.ConfigExist()
#CLI Arguments
parser=argparse.ArgumentParser(prog="Lunar Client Lite Python (LCLPy)",
description="A debloated, feature rich and CLI based launcher for Lunar Client. Made in Python.",
usage="\nLCLPy -v <Version>\nLCLPy -s <Version> <Server IP>")
command=parser.add_mutually_exclusive_group(required=True)
command.add_argument('-v','-version',
action="store",
nargs=1,
metavar=("<Version>"),
help="Version => 1.7/1.8/1.12/1.16/1.17/1.18")
command.add_argument('-d','-debug',
action="store",
nargs=1,
metavar=("<Version>"),
help="Displays the selected version, JRE path, launch directory, arguments and launch command.")
command.add_argument('-s','-server',
action="store",
nargs=2,
metavar=("<Version>", "<Server IP>"),
help="Version => 1.7/1.8/1.12/1.16/1.17/1.18")
command.add_argument('-edit',
action='store_true',
help="Edit LCLPy's Config File.")
args = parser.parse_args()
#Arguments
if args.v != None:
launch.Launch(str(args.v[0]), " ", False)
elif args.edit == True:
subprocess.Popen(["start", "Options.ini"], shell=True)
elif args.s != None:
launch.Launch(str(args.s[0]), "-server "+args.s[1], False)
elif args.d != None:
launch.Launch(str(args.d[0]), " ", True)