@@ -5,10 +5,12 @@ fn usage(prog, error) {
55 if error != () {
66 print(`Error: ${error}`);
77 }
8- print(`Usage: faux-mgs ... rhai ${prog} [-v] [-h] [-c config.json]`);
8+ print(`Usage: faux-mgs ... rhai ${prog} [-v] [-h] [-c config.json] [path0] [path1] `);
99 print(" -c CONFIG.JSON # Path to configuration");
1010 print(" -v # be verbose");
1111 print(" -h # Help. Print this message");
12+ print("path0 - optionally override configuration base_repo value");
13+ print("path1 - optionally override configuration ut_repo value");
1214 print("");
1315}
1416
@@ -152,7 +154,7 @@ fn main() {
152154
153155 debug(`info|${v.up_down} SP Hubris to ${v.label} image`);
154156 if !update_sp(v.sp_path) {
155- debug(`error|Failed to ${v.up_down} SP Hubris to ${v.label} image: ${r} `);
157+ debug(`error|Failed to ${v.up_down} SP Hubris to ${v.label} image`);
156158 return 1;
157159 }
158160
@@ -229,6 +231,22 @@ fn process_cli(argv) {
229231 print(`config=${config}`);
230232 }
231233
234+ // Optionally override baseline and under test repo from command line
235+ let repo_path = parsed?.positional[0];
236+ if repo_path != () {
237+ print("override config base_repo:");
238+ print(` was: ${config?.base_repo}`);
239+ config.base_repo = repo_path;
240+ print(` now: ${config?.base_repo}`);
241+ }
242+ let repo_path = parsed?.positional[1];
243+ if repo_path != () {
244+ print("override config ut_repo:");
245+ print(` was: ${config?.ut_repo}`);
246+ config.ut_repo = repo_path;
247+ print(` now: ${config?.ut_repo}`);
248+ }
249+
232250 // Expand the paths to archives so that the config file
233251 // can use vars from the environment and the configuration file itself.
234252 conf["sp_bord"] = util::env_expand(config.bord.sp, config);
0 commit comments