File tree Expand file tree Collapse file tree 1 file changed +8
-5
lines changed
Expand file tree Collapse file tree 1 file changed +8
-5
lines changed Original file line number Diff line number Diff line change 1010import subprocess
1111import sys
1212from datetime import date
13- from dire import die
1413
1514
1615# --------------------------------------------------
@@ -33,7 +32,12 @@ def get_args():
3332 help = 'Overwrite existing' ,
3433 action = 'store_true' )
3534
36- return parser .parse_args ()
35+ args = parser .parse_args ()
36+
37+ if not args .program .strip ():
38+ parser .error ('program is not a usable filename' )
39+
40+ return args
3741
3842
3943# --------------------------------------------------
@@ -43,9 +47,8 @@ def main():
4347 args = get_args ()
4448 out_file = args .program .strip ().replace ('-' , '_' )
4549
46- if not out_file : die ('Not a usable filename "{}"' .format (out_file ))
47-
48- if not out_file .endswith ('.py' ): out_file += '.py'
50+ if not out_file .endswith ('.py' ):
51+ out_file += '.py'
4952
5053 if os .path .isfile (out_file ) and not args .force :
5154 answer = input ('"{}" exists. Overwrite? [yN] ' .format (out_file ))
You can’t perform that action at this time.
0 commit comments