Fixed crash when arguments ending with a slash are given to enable, disable, and toggle.
This commit is contained in:
parent
fa6f4e7a63
commit
1dfe472a57
1 changed files with 3 additions and 0 deletions
|
@ -314,6 +314,7 @@ def command_list(args: list, cfg: Config, profiles: ModProfiles):
|
|||
print(f"Usage: {args[0]} {args[1]} [profiles]")
|
||||
|
||||
def command_enable(args: list, cfg: Config, profiles: ModProfiles):
|
||||
args = [a.rstrip("/") for a in args]
|
||||
for mod in args[2:]:
|
||||
if not mod in ("-a", "-A", "*"):
|
||||
enable_mod(cfg, mod)
|
||||
|
@ -326,6 +327,7 @@ def command_enable(args: list, cfg: Config, profiles: ModProfiles):
|
|||
break
|
||||
|
||||
def command_disable(args: list, cfg: Config, profiles: ModProfiles):
|
||||
args = [a.rstrip("/") for a in args]
|
||||
for mod in args[2:]:
|
||||
if not mod in ("-a", "-A", "*"):
|
||||
disable_mod(cfg, mod)
|
||||
|
@ -336,6 +338,7 @@ def command_disable(args: list, cfg: Config, profiles: ModProfiles):
|
|||
break
|
||||
|
||||
def command_toggle(args: list, cfg: Config, profiles: ModProfiles):
|
||||
args = [a.rstrip("/") for a in args]
|
||||
for mod in args[2:]:
|
||||
toggle_mod(cfg, mod)
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue