fix postupdate

This commit is contained in:
j 2015-03-07 21:47:52 +05:30
parent 557f4d3ea9
commit f69377408d

View file

@ -81,7 +81,6 @@ def command_postupdate(*args):
"""
Called after update with -o old -n new
"""
def run(*args):
o, old, n, new = args
if o != '-o' or n != '-n':
print('usage: -o oldversion -n newversion')
@ -214,7 +213,7 @@ def main():
commands = [c[8:] for c in actions if c.startswith('command_')]
command = sys.argv[1] if len(sys.argv) > 1 else None
if command and command in commands:
globals()["command_%s"%command](sys.argv[1:])
globals()["command_%s"%command](*sys.argv[2:])
else:
print("usage: ctl [action]")
indent = max([len(command) for command in commands]) + 4