Add --list-profiles and --list-layouts options
This commit is contained in:
parent
40a2bb3843
commit
8f41308cb2
|
@ -18,7 +18,9 @@
|
||||||
import sys
|
import sys
|
||||||
import os
|
import os
|
||||||
|
|
||||||
|
# FIXME optparse is deprecated - argparse be used instead
|
||||||
from optparse import OptionParser, SUPPRESS_HELP
|
from optparse import OptionParser, SUPPRESS_HELP
|
||||||
|
from terminatorlib.terminator import Terminator
|
||||||
from .util import dbg, err
|
from .util import dbg, err
|
||||||
from . import util
|
from . import util
|
||||||
from . import config
|
from . import config
|
||||||
|
@ -104,6 +106,10 @@ icon for the window (by file or name)'))
|
||||||
help=_('If Terminator is already running, just open a new tab'))
|
help=_('If Terminator is already running, just open a new tab'))
|
||||||
parser.add_option('--unhide', action='store_true', dest='unhide',
|
parser.add_option('--unhide', action='store_true', dest='unhide',
|
||||||
help=_('If Terminator is already running, just unhide all hidden windows'))
|
help=_('If Terminator is already running, just unhide all hidden windows'))
|
||||||
|
parser.add_option('--list-profiles', action='store_true', dest='list_profiles',
|
||||||
|
help=_('List all profiles'))
|
||||||
|
parser.add_option('--list-layouts', action='store_true', dest='list_layouts',
|
||||||
|
help=_('List all layouts'))
|
||||||
|
|
||||||
for item in ['--sm-client-id', '--sm-config-prefix', '--screen', '-n',
|
for item in ['--sm-client-id', '--sm-config-prefix', '--screen', '-n',
|
||||||
'--no-gconf' ]:
|
'--no-gconf' ]:
|
||||||
|
@ -119,6 +125,13 @@ icon for the window (by file or name)'))
|
||||||
print('%s %s' % (version.APP_NAME, version.APP_VERSION))
|
print('%s %s' % (version.APP_NAME, version.APP_VERSION))
|
||||||
sys.exit(0)
|
sys.exit(0)
|
||||||
|
|
||||||
|
if options.list_profiles:
|
||||||
|
print(Terminator().config.list_profiles())
|
||||||
|
sys.exit(0)
|
||||||
|
if options.list_layouts:
|
||||||
|
print(Terminator().config.list_layouts())
|
||||||
|
sys.exit(0)
|
||||||
|
|
||||||
if options.debug_classes or options.debug_methods:
|
if options.debug_classes or options.debug_methods:
|
||||||
if not options.debug > 0:
|
if not options.debug > 0:
|
||||||
options.debug = 1
|
options.debug = 1
|
||||||
|
|
Loading…
Reference in New Issue