Fix gen command line parsing

This commit is contained in:
Oleksii Shevchuk 2017-03-11 11:47:45 +02:00
parent 8e285ea8a0
commit 4e6d1d3241
1 changed files with 5 additions and 1 deletions

View File

@ -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'):