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'))