only check arg number at all when not "$-"

This commit is contained in:
jesopo 2019-09-30 16:33:21 +01:00
parent a9021813e5
commit afb07f6531

View file

@ -69,15 +69,14 @@ class Module(ModuleManager.BaseModule):
if match.group(1): if match.group(1):
index = int(match.group(1)) index = int(match.group(1))
continuous = match.group(2) == "-" continuous = match.group(2) == "-"
else:
index = -1
continuous = True
if index >= len(args_split): if index >= len(args_split):
raise IndexError("Unknown alias arg index") raise IndexError("Unknown alias arg index")
else:
index = 0
continuous = True
if continuous: if continuous:
replace = " ".join(args_split[min(index, 0):]) replace = " ".join(args_split[index:])
else: else:
replace = args_split[index] replace = args_split[index]
s = s.replace(match.group(0), replace) s = s.replace(match.group(0), replace)