From 04508df7ff36cbd8d384325dcb7b49032d2c6a5c Mon Sep 17 00:00:00 2001 From: Vishweshwar Saran Singh Deo Date: Sun, 8 Dec 2024 19:54:59 +0530 Subject: [PATCH] - [bug 678] fix argument handling of the --execute flag - [bug 939] execute still broken - [bug 923] terminator -x gets confused by - fixed double dash -- by handling extra arguements, need to cross check against all use cases - currently its done in terminal.py need to check if other dependencies but first I want to get - the behavior right --- terminatorlib/optionparse.py | 3 ++- terminatorlib/terminal.py | 6 ++++++ 2 files changed, 8 insertions(+), 1 deletion(-) 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: