Commit 8ca085a7 authored by Keegi's avatar Keegi

changed order of parsing startup config files and -e commands

parent 54e208a1
......@@ -359,8 +359,6 @@ class pronsole(cmd.Cmd):
del rci,rco
def preloop(self):
if not self.rc_loaded:
self.load_default_rc()
print "Welcome to the printer console! Type \"help\" for a list of available commands."
cmd.Cmd.preloop(self)
......@@ -1028,12 +1026,22 @@ class pronsole(cmd.Cmd):
def parse_cmdline(self,args):
import getopt
opts,args = getopt.getopt(args, "c:e:", ["conf=","config="])
opts,args = getopt.getopt(args, "c:e:h", ["conf=","config=","help"])
for o,a in opts:
#print repr((o,a))
if o in ("-c","--conf","--config"):
self.load_rc(a)
elif o == "-e":
elif o in ("-h","--help"):
print "Usage: "+sys.argv[0]+' [-c filename [-c filename2 ... ] ] [-e "command" ...]'
print " -c | --conf | --config - override startup .pronsolerc file"
print " may chain config files, settings auto-save will go into last file in the chain"
print ' -e <command> - executes command after configuration/.pronsolerc is loaded'
print " macros/settings from these commands are not autosaved"
sys.exit()
if not self.rc_loaded:
self.load_default_rc()
for o,a in opts:
if o == "-e":
self.processing_args = True
self.onecmd(a)
self.processing_args = False
......
......@@ -84,8 +84,6 @@ class PronterWindow(wx.Frame,pronsole.pronsole):
self.custombuttons=[]
self.btndict={}
self.parse_cmdline(sys.argv[1:])
if not self.rc_loaded:
self.load_default_rc(".pronsolerc")
customdict={}
try:
execfile("custombtn.txt",customdict)
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment