From c566e862f74f1ac3b5fbd64cd2c2b515d9f32cd2 Mon Sep 17 00:00:00 2001 From: Neal Fultz Date: Sun, 4 Aug 2013 12:36:33 -0700 Subject: [PATCH] Bug 366644 / Don't modify -x when invoked as x-terminal-emulator --- terminatorlib/optionparse.py | 21 ++++++++++++++------- 1 file changed, 14 insertions(+), 7 deletions(-) diff --git a/terminatorlib/optionparse.py b/terminatorlib/optionparse.py index b748c941..bc5ae68c 100755 --- a/terminatorlib/optionparse.py +++ b/terminatorlib/optionparse.py @@ -42,10 +42,7 @@ 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) + is_X_terminal_emulator = os.path.basename(sys.argv[0]) == 'x-terminal-emulator' parser = OptionParser(usage) @@ -64,11 +61,21 @@ 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(dash_e, '--command', dest='command', - help=_('Specify a command to execute inside the terminal')) + + if not is_X_terminal_emulator : + parser.add_option('-e', '--command', dest='command', + help=_('Specify a command to execute inside the terminal')) + else : + parser.add_option('--command', dest='command', + help=_('Specify a command to execute inside the terminal')) + parser.add_option('-e', '--execute2', 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')) + parser.add_option('-g', '--config', dest='config', help=_('Specify a config file')) - parser.add_option(dash_x, '--execute', dest='execute', action='callback', + parser.add_option('-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'))