Support passing config as first argument

rr/dockerize
Ryan Rix 2016-07-12 23:59:35 -07:00
parent 56425527bc
commit 32c60c085f
1 changed files with 2 additions and 2 deletions

View File

@ -3,7 +3,7 @@
import configparser
from os.path import expanduser,exists
from cmdlistener import CmdListener
from sys import exit
from sys import exit,argv
# Error Codes:
# 1 - Unknown problem has occured
# 2 - Could not find the server.
@ -57,7 +57,7 @@ def read_config(path):
return True
#Get config
cfgfile = expanduser("~/.config/mpddj.ini")
cfgfile = argv[1] or expanduser("~/.config/mpddj.ini")
config = None
if not exists(cfgfile):
print("Config file not found, writing a new one")