diff --git a/deluge/ui/console/main.py b/deluge/ui/console/main.py index 96f6286ae..be84926e1 100644 --- a/deluge/ui/console/main.py +++ b/deluge/ui/console/main.py @@ -174,10 +174,12 @@ class ConsoleUI(component.Component): d = defer.succeed(None) # If we have args, lets process them and quit # allow multiple commands split by ";" - for arg in args.split(";"): - d.addCallback(do_command, arg.strip()) + commands = [arg.strip() for arg in args.split(';')] + for command in commands: + d.addCallback(do_command, command) - d.addCallback(do_command, "quit") + if "quit" not in commands: + d.addCallback(do_command, "quit") # We need to wait for the rpcs in start() to finish before processing # any of the commands.