Issue 4733; improved help and sparate commands for show and set config settings.

svn: r16813
This commit is contained in:
Peter Landgren 2011-03-12 15:32:50 +00:00
parent f7ab37fb83
commit 8cce3a3098

View File

@ -69,8 +69,9 @@ Application options
-l List Family Trees -l List Family Trees
-L List Family Trees in Detail -L List Family Trees in Detail
-u, --force-unlock Force unlock of family tree -u, --force-unlock Force unlock of family tree
-c, --config=[config.setting[:value]] Show/set config setting(s) -s, --show Show config settings
-v, --version Show versions and settings -c, --config=[config.setting[:value]] Set config setting(s) and start Gramps
-v, --version Show versions
""") """)
_USAGE = _(""" _USAGE = _("""
@ -275,10 +276,20 @@ class ArgParser(object):
logger = logging.getLogger(value) logger = logging.getLogger(value)
logger.setLevel(logging.DEBUG) logger.setLevel(logging.DEBUG)
cleandbg += [opt_ix] cleandbg += [opt_ix]
elif option in ('-l',): elif option in ('-l'):
self.list = True self.list = True
elif option in ('-L',): elif option in ('-L'):
self.list_more = True self.list_more = True
elif option in ('-s','--show'):
print "Gramps config settings from %s:" % \
config.config.filename.encode(sys.getfilesystemencoding())
for section in config.config.data:
for setting in config.config.data[section]:
print "%s.%s=%s" % (
section, setting,
repr(config.config.data[section][setting]))
print
sys.exit(0)
elif option in ('-c', '--config'): elif option in ('-c', '--config'):
setting_name = value setting_name = value
set_value = False set_value = False
@ -307,16 +318,6 @@ class ArgParser(object):
print >> sys.stderr, "Gramps: no such config setting:" \ print >> sys.stderr, "Gramps: no such config setting:" \
" '%s'" % setting_name " '%s'" % setting_name
need_to_quit = True need_to_quit = True
else:
print "Gramps config settings from %s:" % \
config.config.filename.encode(sys.getfilesystemencoding())
for section in config.config.data:
for setting in config.config.data[section]:
print "%s.%s=%s" % (
section, setting,
repr(config.config.data[section][setting]))
print
sys.exit(0)
cleandbg += [opt_ix] cleandbg += [opt_ix]
elif option in ('-h', '-?', '--help'): elif option in ('-h', '-?', '--help'):
self.help = True self.help = True