From 69f0e7c30e26280b7c3e19d52d552ebf4259d7e8 Mon Sep 17 00:00:00 2001 From: Neal Fultz Date: Sun, 12 May 2013 21:44:07 -0700 Subject: [PATCH] Fixing Bug #366644 / terminator does not honor x-terminal-emulator -e option --- terminatorlib/optionparse.py | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/terminatorlib/optionparse.py b/terminatorlib/optionparse.py index 9597cd96..b748c941 100755 --- a/terminatorlib/optionparse.py +++ b/terminatorlib/optionparse.py @@ -42,6 +42,11 @@ def parse_options(): """Parse the command line options""" usage = "usage: %prog [options]" + isXTerminalEmulator = os.path.basename(sys.argv[0]) == 'x-terminal-emulator' + dash_e = '-e' + dash_x = '-x' + if isXTerminalEmulator: (dash_e, dash_x) = (dash_x, dash_e) + parser = OptionParser(usage) parser.add_option('-v', '--version', action='store_true', dest='version', @@ -59,11 +64,11 @@ def parse_options(): parser.add_option('--geometry', dest='geometry', type='string', help=_('Set the preferred size and position of the window' '(see X man page)')) - parser.add_option('-e', '--command', dest='command', + parser.add_option(dash_e, '--command', dest='command', help=_('Specify a command to execute inside the terminal')) parser.add_option('-g', '--config', dest='config', help=_('Specify a config file')) - parser.add_option('-x', '--execute', dest='execute', action='callback', + parser.add_option(dash_x, '--execute', dest='execute', action='callback', callback=execute_cb, help=_('Use the rest of the command line as a command to execute ' 'inside the terminal, and its arguments'))