fix postupdate
This commit is contained in:
parent
557f4d3ea9
commit
f69377408d
1 changed files with 10 additions and 11 deletions
|
@ -81,7 +81,6 @@ def command_postupdate(*args):
|
||||||
"""
|
"""
|
||||||
Called after update with -o old -n new
|
Called after update with -o old -n new
|
||||||
"""
|
"""
|
||||||
def run(*args):
|
|
||||||
o, old, n, new = args
|
o, old, n, new = args
|
||||||
if o != '-o' or n != '-n':
|
if o != '-o' or n != '-n':
|
||||||
print('usage: -o oldversion -n newversion')
|
print('usage: -o oldversion -n newversion')
|
||||||
|
@ -214,7 +213,7 @@ def main():
|
||||||
commands = [c[8:] for c in actions if c.startswith('command_')]
|
commands = [c[8:] for c in actions if c.startswith('command_')]
|
||||||
command = sys.argv[1] if len(sys.argv) > 1 else None
|
command = sys.argv[1] if len(sys.argv) > 1 else None
|
||||||
if command and command in commands:
|
if command and command in commands:
|
||||||
globals()["command_%s"%command](sys.argv[1:])
|
globals()["command_%s"%command](*sys.argv[2:])
|
||||||
else:
|
else:
|
||||||
print("usage: ctl [action]")
|
print("usage: ctl [action]")
|
||||||
indent = max([len(command) for command in commands]) + 4
|
indent = max([len(command) for command in commands]) + 4
|
||||||
|
|
Loading…
Reference in a new issue