mirror of
https://github.com/mnaberez/py65.git
synced 2024-10-16 01:23:45 +00:00
Move defaults outside of getopt try/except block
This commit is contained in:
parent
fe72839124
commit
71f41cc0c7
@ -62,6 +62,11 @@ class Monitor(cmd.Cmd):
|
|||||||
shortopts = 'hi:o:m:l:r:g:'
|
shortopts = 'hi:o:m:l:r:g:'
|
||||||
longopts = ['help', 'mpu=', 'input=', 'output=', 'load=', 'rom=', 'goto=']
|
longopts = ['help', 'mpu=', 'input=', 'output=', 'load=', 'rom=', 'goto=']
|
||||||
options, args = getopt.getopt(argv[1:], shortopts, longopts)
|
options, args = getopt.getopt(argv[1:], shortopts, longopts)
|
||||||
|
except getopt.GetoptError as exc:
|
||||||
|
self._output(exc.args[0])
|
||||||
|
self._usage()
|
||||||
|
self._exit(1)
|
||||||
|
|
||||||
flag_load = False
|
flag_load = False
|
||||||
load_value = ""
|
load_value = ""
|
||||||
flag_rom = False
|
flag_rom = False
|
||||||
@ -70,13 +75,8 @@ class Monitor(cmd.Cmd):
|
|||||||
goto_value = ""
|
goto_value = ""
|
||||||
flag_mpu = False
|
flag_mpu = False
|
||||||
mpu_value = "6502"
|
mpu_value = "6502"
|
||||||
except getopt.GetoptError as exc:
|
|
||||||
self._output(exc.args[0])
|
|
||||||
self._usage()
|
|
||||||
self._exit(1)
|
|
||||||
|
|
||||||
for opt, value in options:
|
for opt, value in options:
|
||||||
|
|
||||||
if opt in ('-i', '--input'):
|
if opt in ('-i', '--input'):
|
||||||
self.getc_addr = int(value, 16)
|
self.getc_addr = int(value, 16)
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user