Add --config switch to specify the config directory on startup. Patch

from slurdge.
This commit is contained in:
Andrew Resch 2007-11-14 23:40:05 +00:00
parent 2b519730bc
commit abc9534f7f

View File

@ -48,8 +48,12 @@ import deluge.pref
parser = OptionParser(usage="%prog [options] [torrents to add]", parser = OptionParser(usage="%prog [options] [torrents to add]",
version=deluge.common.PROGRAM_VERSION) version=deluge.common.PROGRAM_VERSION)
parser.add_option("-c", "--config", dest="config", help="Sets the configuration path")
(options, args) = parser.parse_args() (options, args) = parser.parse_args()
if (options.config != None):
deluge.common.CONFIG_DIR = options.config
def upgrade_old_persistent_state(): def upgrade_old_persistent_state():
pstate_file_path = os.path.join(deluge.common.CONFIG_DIR, pstate_file_path = os.path.join(deluge.common.CONFIG_DIR,
deluge.core.STATE_FILENAME) deluge.core.STATE_FILENAME)