File tree Expand file tree Collapse file tree 6 files changed +27
-4
lines changed Expand file tree Collapse file tree 6 files changed +27
-4
lines changed Original file line number Diff line number Diff line change 9
9
rm -rf test/__pycache__
10
10
rm -rf zxtools/__pycache__
11
11
rm -rf zxtools.egg-info
12
+ rm -rf coverage.xml
12
13
13
14
coverage :
14
15
coverage run --source zxtools setup.py test
Original file line number Diff line number Diff line change @@ -24,6 +24,9 @@ def test_args_parser(self):
24
24
with self .assertRaises (SystemExit ):
25
25
hobeta .parse_args (("-h" , "-v" ))
26
26
27
+ with self .assertRaises (SystemExit ):
28
+ hobeta .parse_args (())
29
+
27
30
temp_in_file = tempfile .mkstemp ()[1 ]
28
31
input_file = open (temp_in_file , "w" )
29
32
input_file .close ()
Original file line number Diff line number Diff line change @@ -25,6 +25,9 @@ def test_args_parser(self):
25
25
with self .assertRaises (SystemExit ):
26
26
zeus2txt .parse_args (("-h" , "-v" ))
27
27
28
+ with self .assertRaises (SystemExit ):
29
+ zeus2txt .parse_args (())
30
+
28
31
temp_in_file = tempfile .mkstemp ()[1 ]
29
32
input_file = open (temp_in_file , "w" )
30
33
input_file .close ()
Original file line number Diff line number Diff line change 8
8
# See LICENSE file in the project root for full license information.
9
9
#
10
10
11
- __version__ = '1.0.21 '
12
- CHUNK_SIZE = 512 * 1024 # 512 KBytes
11
+ __version__ = '1.0.22 '
12
+ CHUNK_SIZE = 512 * 1024 # 512 KBytes
Original file line number Diff line number Diff line change @@ -153,7 +153,15 @@ def parse_args(args):
153
153
help = "Show Hobeta header format description" )
154
154
help_parser .set_defaults (func = hobeta_help )
155
155
156
- return parser .parse_args (args )
156
+ try :
157
+ options = parser .parse_args (args )
158
+ if len (args ) == 0 :
159
+ raise ValueError
160
+ except :
161
+ parser .print_help ()
162
+ sys .exit (0 )
163
+
164
+ return options
157
165
158
166
159
167
def main ():
Original file line number Diff line number Diff line change @@ -135,7 +135,15 @@ def parse_args(args):
135
135
action = 'store_true' , help = "Include original code in the output file" )
136
136
convert_parser .set_defaults (func = convert_file )
137
137
138
- return parser .parse_args (args )
138
+ try :
139
+ options = parser .parse_args (args )
140
+ if len (args ) == 0 :
141
+ raise ValueError
142
+ except :
143
+ parser .print_help ()
144
+ sys .exit (0 )
145
+
146
+ return options
139
147
140
148
141
149
def main ():
You can’t perform that action at this time.
0 commit comments