Fixing Bug #366644 / terminator does not honor x-terminal-emulator -e option

This commit is contained in:
Neal Fultz 2013-05-12 21:44:07 -07:00
parent 20c21f36b2
commit 69f0e7c30e

View File

@ -42,6 +42,11 @@ def parse_options():
"""Parse the command line options""" """Parse the command line options"""
usage = "usage: %prog [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 = OptionParser(usage)
parser.add_option('-v', '--version', action='store_true', dest='version', 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', parser.add_option('--geometry', dest='geometry', type='string',
help=_('Set the preferred size and position of the window' help=_('Set the preferred size and position of the window'
'(see X man page)')) '(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')) help=_('Specify a command to execute inside the terminal'))
parser.add_option('-g', '--config', dest='config', parser.add_option('-g', '--config', dest='config',
help=_('Specify a config file')) 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, callback=execute_cb,
help=_('Use the rest of the command line as a command to execute ' help=_('Use the rest of the command line as a command to execute '
'inside the terminal, and its arguments')) 'inside the terminal, and its arguments'))