mirror of
https://github.com/mnaberez/py65.git
synced 2024-09-07 02:54:23 +00:00
Move defaults outside of getopt try/except block
This commit is contained in:
parent
fe72839124
commit
71f41cc0c7
@ -62,21 +62,21 @@ 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)
|
||||||
flag_load = False
|
|
||||||
load_value = ""
|
|
||||||
flag_rom = False
|
|
||||||
rom_value = ""
|
|
||||||
flag_goto = False
|
|
||||||
goto_value = ""
|
|
||||||
flag_mpu = False
|
|
||||||
mpu_value = "6502"
|
|
||||||
except getopt.GetoptError as exc:
|
except getopt.GetoptError as exc:
|
||||||
self._output(exc.args[0])
|
self._output(exc.args[0])
|
||||||
self._usage()
|
self._usage()
|
||||||
self._exit(1)
|
self._exit(1)
|
||||||
|
|
||||||
for opt, value in options:
|
flag_load = False
|
||||||
|
load_value = ""
|
||||||
|
flag_rom = False
|
||||||
|
rom_value = ""
|
||||||
|
flag_goto = False
|
||||||
|
goto_value = ""
|
||||||
|
flag_mpu = False
|
||||||
|
mpu_value = "6502"
|
||||||
|
|
||||||
|
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