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():
26
26
help = 'Output filename' ,
27
27
metavar = 'str' ,
28
28
type = argparse .FileType ('wt' ),
29
- default = '' )
29
+ default = None )
30
30
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
32
37
33
38
34
39
# --------------------------------------------------
35
40
def main ():
36
41
"""Make a jazz noise here"""
37
42
38
43
args = get_args ()
39
- str_args = args .input
44
+ str_args = args .input . upper ()
40
45
outfile_args = args .outfile
41
46
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 } ' )
46
48
47
49
48
50
# --------------------------------------------------
You can’t perform that action at this time.
0 commit comments