add -c option to history_manager. Fixes #5058
This commit is contained in:
parent
5a72c9b3ac
commit
e6efcebfa8
|
@ -53,9 +53,34 @@ import gobject
|
||||||
import time
|
import time
|
||||||
import locale
|
import locale
|
||||||
|
|
||||||
|
import getopt
|
||||||
from common import i18n
|
from common import i18n
|
||||||
|
|
||||||
|
def parseOpts():
|
||||||
|
config_path = None
|
||||||
|
|
||||||
|
try:
|
||||||
|
shortargs = 'hc:'
|
||||||
|
longargs = 'help config_path='
|
||||||
|
opts = getopt.getopt(sys.argv[1:], shortargs, longargs.split())[0]
|
||||||
|
except getopt.error, msg:
|
||||||
|
print str(msg)
|
||||||
|
print 'for help use --help'
|
||||||
|
sys.exit(2)
|
||||||
|
for o, a in opts:
|
||||||
|
if o in ('-h', '--help'):
|
||||||
|
print 'history_manager [--help] [--config-path]'
|
||||||
|
sys.exit()
|
||||||
|
elif o in ('-c', '--config-path'):
|
||||||
|
config_path = a
|
||||||
|
return config_path
|
||||||
|
|
||||||
|
config_path = parseOpts()
|
||||||
|
del parseOpts
|
||||||
|
|
||||||
import common.configpaths
|
import common.configpaths
|
||||||
common.configpaths.gajimpaths.init()
|
common.configpaths.gajimpaths.init(config_path)
|
||||||
|
del config_path
|
||||||
common.configpaths.gajimpaths.init_profile()
|
common.configpaths.gajimpaths.init_profile()
|
||||||
from common import exceptions
|
from common import exceptions
|
||||||
import dialogs
|
import dialogs
|
||||||
|
|
Loading…
Reference in New Issue