File tree Expand file tree Collapse file tree 1 file changed +9
-7
lines changed Expand file tree Collapse file tree 1 file changed +9
-7
lines changed Original file line number Diff line number Diff line change @@ -26,23 +26,25 @@ def get_args():
2626 help = 'Output filename' ,
2727 metavar = 'str' ,
2828 type = argparse .FileType ('wt' ),
29- default = '' )
29+ default = None )
3030
31- return parser .parse_args ()
31+ args = parser .parse_args ()
32+
33+ if os .path .isfile (args .input ):
34+ args .input = open (args .input ).read ().rstrip ()
35+
36+ return args
3237
3338
3439# --------------------------------------------------
3540def main ():
3641 """Make a jazz noise here"""
3742
3843 args = get_args ()
39- str_args = args .input
44+ str_args = args .input . upper ()
4045 outfile_args = args .outfile
4146
42- if os .path .isfile (args .input ):
43- str_args = open (str_args ).read ()
44-
45- print (f'{ str_args .upper ()} ' , file = outfile_args ) if outfile_args else print (f'{ str_args .upper ()} ' )
47+ print (f'{ str_args } ' , file = outfile_args ) if outfile_args else print (f'{ str_args } ' )
4648
4749
4850# --------------------------------------------------
You can’t perform that action at this time.
0 commit comments