diff options
author | Sam Thursfield <sam.thursfield@codethink.co.uk> | 2014-12-09 13:58:28 +0000 |
---|---|---|
committer | Sam Thursfield <sam.thursfield@codethink.co.uk> | 2014-12-09 13:58:53 +0000 |
commit | 9449dbfe1bb1800dfb15de025b87e1846e25e74a (patch) | |
tree | f075367c6d2ffd0bffab7b56385f29d972e6e6d3 /morphlib/app.py | |
parent | 8557427c00aecf63bbd0090395acdaf659e77e0f (diff) | |
download | morph-9449dbfe1bb1800dfb15de025b87e1846e25e74a.tar.gz |
Tiny optimisation of app.runcmd code path
Diffstat (limited to 'morphlib/app.py')
-rw-r--r-- | morphlib/app.py | 17 |
1 files changed, 8 insertions, 9 deletions
diff --git a/morphlib/app.py b/morphlib/app.py index b5bcb601..6964be56 100644 --- a/morphlib/app.py +++ b/morphlib/app.py @@ -358,16 +358,15 @@ class Morph(cliapp.Application): else: print_command = True - # convert the command line arguments into a string - commands = [argv] + list(args) - for command in commands: - if isinstance(command, list): - for i in xrange(0, len(command)): - command[i] = str(command[i]) - commands = [' '.join(command) for command in commands] - - # print the command line if print_command: + # Print the command line + commands = [argv] + list(args) + for command in commands: + if isinstance(command, list): + for i in xrange(0, len(command)): + command[i] = str(command[i]) + commands = [' '.join(command) for command in commands] + self.status(msg='# %(cmdline)s', cmdline=' | '.join(commands), chatty=True) |