only check arg number at all when not "$-"
This commit is contained in:
parent
a9021813e5
commit
afb07f6531
1 changed files with 4 additions and 5 deletions
|
@ -69,15 +69,14 @@ class Module(ModuleManager.BaseModule):
|
|||
if match.group(1):
|
||||
index = int(match.group(1))
|
||||
continuous = match.group(2) == "-"
|
||||
else:
|
||||
index = -1
|
||||
continuous = True
|
||||
|
||||
if index >= len(args_split):
|
||||
raise IndexError("Unknown alias arg index")
|
||||
else:
|
||||
index = 0
|
||||
continuous = True
|
||||
|
||||
if continuous:
|
||||
replace = " ".join(args_split[min(index, 0):])
|
||||
replace = " ".join(args_split[index:])
|
||||
else:
|
||||
replace = args_split[index]
|
||||
s = s.replace(match.group(0), replace)
|
||||
|
|
Loading…
Reference in a new issue