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):
|
if match.group(1):
|
||||||
index = int(match.group(1))
|
index = int(match.group(1))
|
||||||
continuous = match.group(2) == "-"
|
continuous = match.group(2) == "-"
|
||||||
|
if index >= len(args_split):
|
||||||
|
raise IndexError("Unknown alias arg index")
|
||||||
else:
|
else:
|
||||||
index = -1
|
index = 0
|
||||||
continuous = True
|
continuous = True
|
||||||
|
|
||||||
if index >= len(args_split):
|
|
||||||
raise IndexError("Unknown alias arg index")
|
|
||||||
|
|
||||||
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)
|
||||||
|
|
Loading…
Reference in a new issue