File tree Expand file tree Collapse file tree 5 files changed +35
-101
lines changed Expand file tree Collapse file tree 5 files changed +35
-101
lines changed Original file line number Diff line number Diff line change @@ -42,13 +42,18 @@ struct ConfigFile {
4242 pub content : String ,
4343}
4444
45- /// Gets the paths (colon -separated) from the `AXVISOR_VM_CONFIGS` environment variable.
45+ /// Gets the paths (semicolon -separated) from the `AXVISOR_VM_CONFIGS` environment variable.
4646///
4747/// Returns `None` if the environment variable is not set.
4848fn get_config_paths ( ) -> Option < Vec < OsString > > {
4949 env:: var ( "AXVISOR_VM_CONFIGS" )
5050 . ok ( )
51- . map ( |paths| env:: split_paths ( & paths) . map ( OsString :: from) . collect ( ) )
51+ . map ( |paths| {
52+ paths
53+ . split ( ';' )
54+ . map ( |s| OsString :: from ( s. trim ( ) ) )
55+ . collect ( )
56+ } )
5257}
5358
5459/// Gets the paths and contents of the configuration files specified by the `AXVISOR_VM_CONFIGS` environment variable.
Original file line number Diff line number Diff line change @@ -3,7 +3,7 @@ use ostool::ctx::AppContext;
33pub struct Context {
44 pub ctx : AppContext ,
55 pub build_config_path : Option < std:: path:: PathBuf > ,
6- pub vmconfigs : Vec < String > ,
6+ pub vmconfigs : String ,
77}
88
99impl Context {
@@ -18,7 +18,7 @@ impl Context {
1818 Context {
1919 ctx,
2020 build_config_path : None ,
21- vmconfigs : vec ! [ ] ,
21+ vmconfigs : String :: new ( ) ,
2222 }
2323 }
2424}
Original file line number Diff line number Diff line change @@ -44,12 +44,15 @@ enum Commands {
4444
4545#[ derive( Parser ) ]
4646struct QemuArgs {
47+ /// Path to the build configuration file
4748 #[ arg( long) ]
4849 build_config : Option < PathBuf > ,
50+ /// Path to the QEMU configuration file
4951 #[ arg( long) ]
5052 qemu_config : Option < PathBuf > ,
53+ /// VM configuration files (comma-separated paths)
5154 #[ arg( long) ]
52- vmconfigs : Vec < String > ,
55+ vmconfigs : String ,
5356}
5457
5558#[ derive( Parser ) ]
@@ -76,12 +79,15 @@ struct ClippyArgs {
7679
7780#[ derive( Parser ) ]
7881struct UbootArgs {
82+ /// Path to the build configuration file
7983 #[ arg( long) ]
8084 build_config : Option < PathBuf > ,
85+ /// Path to the uboot configuration file
8186 #[ arg( long) ]
8287 uboot_config : Option < PathBuf > ,
88+ /// VM configuration files (comma-separated paths)
8389 #[ arg( long) ]
84- vmconfigs : Vec < String > ,
90+ vmconfigs : String ,
8591}
8692
8793#[ tokio:: main]
Original file line number Diff line number Diff line change @@ -45,8 +45,15 @@ impl Context {
4545
4646 self . ctx . build_config_path = Some ( config_path) ;
4747
48- let mut vm_configs = config. vm_configs . to_vec ( ) ;
49- vm_configs. extend ( self . vmconfigs . iter ( ) . cloned ( ) ) ;
48+ let vm_configs = if !self . vmconfigs . is_empty ( ) {
49+ self . vmconfigs
50+ . split ( ',' )
51+ . map ( |s| s. trim ( ) . to_string ( ) )
52+ . filter ( |s| !s. is_empty ( ) )
53+ . collect ( )
54+ } else {
55+ vec ! [ ]
56+ } ;
5057
5158 let mut vm_config_paths = vec ! [ ] ;
5259 for vm_config in & vm_configs {
You can’t perform that action at this time.
0 commit comments