diff --git a/.DS_Store b/.DS_Store new file mode 100644 index 0000000..a5c2315 Binary files /dev/null and b/.DS_Store differ diff --git a/pecan/commands/base.py b/pecan/commands/base.py index 5451444..c167c49 100644 --- a/pecan/commands/base.py +++ b/pecan/commands/base.py @@ -78,7 +78,10 @@ class CommandRunner(object): ) for arg in getattr(cmd, 'arguments', tuple()): arg = arg.copy() - sub.add_argument(arg.pop('command'), **arg) + if isinstance(arg.get('command'), basestring): + sub.add_argument(arg.pop('command'), **arg) + elif isinstance(arg.get('command'), list): + sub.add_argument(*arg.pop('command'), **arg) def run(self, args): ns = self.parser.parse_args(args) diff --git a/pecan/commands/shell.py b/pecan/commands/shell.py index dee6aa5..3424103 100644 --- a/pecan/commands/shell.py +++ b/pecan/commands/shell.py @@ -10,7 +10,7 @@ import sys class NativePythonShell(object): @classmethod - def invoke(cls, ns, banner): + def invoke(cls, ns, banner): # pragma: nocover import code py_prefix = sys.platform.startswith('java') and 'J' or 'P' shell_banner = 'Pecan Interactive Shell\n%sython %s\n\n' % \ @@ -26,7 +26,7 @@ class NativePythonShell(object): class IPythonShell(object): @classmethod - def invoke(cls, ns, banner): + def invoke(cls, ns, banner): # pragma: nocover try: from IPython.frontend.terminal.embed import ( InteractiveShellEmbed @@ -51,7 +51,7 @@ class ShellCommand(BaseCommand): } arguments = BaseCommand.arguments + ({ - 'command': '--shell', + 'command': ['--shell', '-s'], 'help': 'which Python shell to use', 'choices': SHELLS.keys(), 'default': 'python'