diff options
Diffstat (limited to 'unperish')
-rwxr-xr-x | unperish | 13 |
1 files changed, 10 insertions, 3 deletions
@@ -64,7 +64,16 @@ class Unperish(cliapp.Application): except IOError: pass - return cliapp.Application.process_args(self, args) + cmd_methods = self._subcommands() + for arg in args: + method = self._normalize_cmd(arg) + if method in cmd_methods: + if self.settings['verbose']: + self.output.write('command: %s\n' % arg) + if not self.settings['no-act']: + getattr(self, method)([]) + else: + raise cliapp.AppException('unknown command %s' % arg) @property def upstream_name(self): @@ -160,8 +169,6 @@ class Unperish(cliapp.Application): logging.debug('runcmd: %s' % repr(argv)) if self.settings['verbose']: self.output.write('run: %s\n' % ' '.join(argv)) - if self.settings['no-act']: - return '' p = subprocess.Popen(argv, stdout=subprocess.PIPE, stderr=subprocess.PIPE, |