diff --git a/terminatorlib/optionparse.py b/terminatorlib/optionparse.py index cd20ff8b..9f30124d 100644 --- a/terminatorlib/optionparse.py +++ b/terminatorlib/optionparse.py @@ -114,7 +114,7 @@ def parse_options(): help=argparse.SUPPRESS) global options - options = parser.parse_args() + options, extra = parser.parse_known_args() if options.version: print('%s %s' % (version.APP_NAME, version.APP_VERSION)) @@ -175,4 +175,5 @@ def parse_options(): if util.DEBUG == True: dbg('command line options: %s' % options) + options.extra = extra return(options,optionslist) diff --git a/terminatorlib/terminal.py b/terminatorlib/terminal.py index 2aaf58d7..918ae909 100644 --- a/terminatorlib/terminal.py +++ b/terminatorlib/terminal.py @@ -1539,6 +1539,12 @@ def spawn_child(self, widget=None, respawn=False, debugserver=False, init_comman options.command = None elif options and options.execute: command = options.execute + dbg('cmd: %s' % command) + if len(options.extra) and options.extra[0] == '--': + options.execute.extend(options.extra[1:]) + command = options.execute + dbg('cmd with extra args: %s' % command) + self.relaunch_command = command options.execute = None elif self.relaunch_command: