File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -12,7 +12,8 @@ def main():
1212 arg_parser .add_argument (
1313 '--source' , '-s' ,
1414 help = 'Path to source YAML file if it differs from {}' .format (default_yaml_path ),
15- default = default_yaml_path
15+ default = default_yaml_path ,
16+ nargs = '+'
1617 )
1718
1819 arg_parser .add_argument (
@@ -28,14 +29,19 @@ def main():
2829 yaml = args .source
2930 ))
3031
31- yaml_obj = read_file (args .source )
32- config_file_contents = process_yaml (yaml_obj )
33-
3432 try :
3533 with open (args .path , 'w' ) as fh :
36- fh .write (config_file_contents )
37- fh .write ("\n " )
34+ fh .write ('# Generated by sshush' )
35+
36+ for file in args .source :
37+ yaml_obj = read_file (file )
38+ config_file_contents = process_yaml (yaml_obj )
39+
40+ fh .write (config_file_contents )
41+ fh .write ("\n " )
42+
3843 print ('{} written successfully' .format (args .path ))
44+
3945 except IOError as exc :
4046 print ('Error:' , exc .strerror )
4147 exit (1 )
Original file line number Diff line number Diff line change @@ -28,7 +28,7 @@ def read_file(file):
2828
2929
3030def process_yaml (ssh_config_yaml ):
31- output = ['# Generated by sshush' ]
31+ output = []
3232
3333 defaults = extract_section ('default' , ssh_config_yaml , {})
3434 global_values = extract_section ('global' , ssh_config_yaml )
You can’t perform that action at this time.
0 commit comments