diff --git a/toml-config/src/config.rs b/toml-config/src/config.rs index 8fb5023b..d56817a2 100644 --- a/toml-config/src/config.rs +++ b/toml-config/src/config.rs @@ -60,6 +60,7 @@ pub enum Action { ConfigureInput { input: Input }, ConfigureOutput { out: Output }, Exec { exec: Exec }, + MoveToWorkspace { name: String }, Multi { actions: Vec }, SetEnv { env: Vec<(String, String)> }, SetGfxApi { api: GfxApi }, diff --git a/toml-config/src/config/parsers/action.rs b/toml-config/src/config/parsers/action.rs index b697f82e..4c5f4d2a 100644 --- a/toml-config/src/config/parsers/action.rs +++ b/toml-config/src/config/parsers/action.rs @@ -133,7 +133,7 @@ impl ActionParser<'_> { fn parse_move_to_workspace(&mut self, ext: &mut Extractor<'_>) -> ParseResult { let name = ext.extract(str("name"))?.value.to_string(); - Ok(Action::ShowWorkspace { name }) + Ok(Action::MoveToWorkspace { name }) } fn parse_configure_connector(&mut self, ext: &mut Extractor<'_>) -> ParseResult { diff --git a/toml-config/src/lib.rs b/toml-config/src/lib.rs index a3ba4adb..c3fffb05 100644 --- a/toml-config/src/lib.rs +++ b/toml-config/src/lib.rs @@ -75,6 +75,10 @@ impl Action { let workspace = get_workspace(&name); Box::new(move || s.show_workspace(workspace)) } + Action::MoveToWorkspace { name } => { + let workspace = get_workspace(&name); + Box::new(move || s.set_workspace(workspace)) + } Action::ConfigureConnector { con } => Box::new(move || { for c in connectors() { if con.match_.matches(c) {