From 4e6d1d324160797aa3ed9ff1a856b75b0e333502 Mon Sep 17 00:00:00 2001 From: Oleksii Shevchuk Date: Sat, 11 Mar 2017 11:47:45 +0200 Subject: [PATCH] Fix gen command line parsing --- pupy/pupylib/PupyCmd.py | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/pupy/pupylib/PupyCmd.py b/pupy/pupylib/PupyCmd.py index e9ecc742..9c9b85cb 100644 --- a/pupy/pupylib/PupyCmd.py +++ b/pupy/pupylib/PupyCmd.py @@ -786,8 +786,8 @@ class PupyCmd(cmd.Cmd): default_arch=default_arch, default_format=default_format ) - arg_parser.add_argument('-L', '--launcher', default='connect', help='Launcher') arg_parser.add_argument('-t', '--transport', default=self.pupsrv.transport, help='Transport') + arg_parser.add_argument('launcher', nargs='?', default='connect', help='Launcher') arg_parser.add_argument( 'launcher_args', nargs=REMAINDER, default=self.pupsrv.transport_kwargs, help='Transport args' @@ -811,6 +811,10 @@ class PupyCmd(cmd.Cmd): self.display_error('payload generation failed: {}'.format(e)) return + if not output: + self.display_error('payload generation failed') + return + if self.pupsrv.httpd and output.startswith(wwwroot): wwwpath = os.path.relpath(output, wwwroot) if self.config.getboolean('httpd', 'secret'):