Index: tools/cr/cr/actions/builder.py |
diff --git a/tools/cr/cr/actions/builder.py b/tools/cr/cr/actions/builder.py |
index 74959afe627e5acf06f07b3e95f0979dc540e02f..286d2ec92e492ae538f9ba57e260a0d63dc8c9c2 100644 |
--- a/tools/cr/cr/actions/builder.py |
+++ b/tools/cr/cr/actions/builder.py |
@@ -4,6 +4,8 @@ |
"""A module for the Builder base class.""" |
+import difflib |
+ |
import cr |
@@ -56,6 +58,11 @@ class Builder(cr.Action, cr.Plugin.Type): |
"""Check if a target name is on the builder knows about.""" |
return target_name in self.GetTargets(context) |
+ @cr.Plugin.activemethod |
+ def GuessTargets(self, context, target_name): |
+ """Returns a list of closest matching targets for a named target.""" |
+ return difflib.get_close_matches(target_name, self.GetTargets(context)) |
+ |
class SkipBuilder(Builder): |
"""The "skip" version of a Builder, causes the build step to be skipped.""" |