diff options
Diffstat (limited to 'src/context.rs')
-rw-r--r-- | src/context.rs | 14 |
1 files changed, 9 insertions, 5 deletions
diff --git a/src/context.rs b/src/context.rs index 77f1389..bb226f5 100644 --- a/src/context.rs +++ b/src/context.rs @@ -131,7 +131,11 @@ impl Context { } pub fn parse<'ctx>(&'ctx self, s: &str) -> Option<TaskRef> { - let id = TaskID(s.to_string()); + let (recipe, task) = s.split_once(":")?; + let id = TaskID { + recipe: recipe.to_string(), + task: task.to_string(), + }; let (ctx_id, _) = self.tasks.get_key_value(&id)?; self.task_ref(ctx_id, &self.default_args).ok() } @@ -167,8 +171,8 @@ impl Context { } fn inherit_ref<'ctx>(&'ctx self, dep: &'ctx InheritDep, args: &TaskArgs) -> Result<TaskRef> { - let mapped_args = Context::map_args(&dep.dep.task, &dep.dep.args, args, false)?; - self.task_ref(&dep.dep.task, mapped_args.as_ref()) + let mapped_args = Context::map_args(&dep.dep.id, &dep.dep.args, args, false)?; + self.task_ref(&dep.dep.id, mapped_args.as_ref()) } pub fn output_ref<'ctx>( @@ -177,9 +181,9 @@ impl Context { args: &TaskArgs, build_dep: bool, ) -> Result<OutputRef<'ctx>> { - let mapped_args = Context::map_args(&dep.dep.task, &dep.dep.args, args, build_dep)?; + let mapped_args = Context::map_args(&dep.dep.id, &dep.dep.args, args, build_dep)?; Ok(OutputRef { - task: self.task_ref(&dep.dep.task, mapped_args.as_ref())?, + task: self.task_ref(&dep.dep.id, mapped_args.as_ref())?, output: &dep.output, }) } |