Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(144)

Unified Diff: recipe_engine/refs.py

Issue 2845843002: [recipes.py] move refs arg parsing to its module (Closed)
Patch Set: rebase Created 3 years, 8 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « no previous file | recipes.py » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: recipe_engine/refs.py
diff --git a/recipe_engine/refs.py b/recipe_engine/refs.py
index bfbc347d3a7b49e8ba76fc3ea1aba2803be7423b..5e998bd0313cfdd179957f982653802096704aee 100644
--- a/recipe_engine/refs.py
+++ b/recipe_engine/refs.py
@@ -7,7 +7,23 @@ from __future__ import print_function
from . import loader
-def main(universe, own_package, modules, transitive):
+def add_subparser(parser):
+ refs_p = parser.add_parser(
+ 'refs',
+ description='List places referencing given recipe module(s).')
+ refs_p.add_argument('modules', nargs='+', help='Module(s) to query for')
+ refs_p.add_argument('--transitive', action='store_true',
+ help='Compute transitive closure of the references')
+
+ refs_p.set_defaults(command='refs', func=main)
+
+
+def main(package_deps, args):
+ universe = loader.RecipeUniverse(package_deps, args.package)
+ own_package = package_deps.root_package
+ modules = args.modules
dnj 2017/04/27 16:40:40 nit: in other CLs, you would have used "args.modul
+ transitive = args.transitive
+
result_modules = set()
result_recipes = set()
« no previous file with comments | « no previous file | recipes.py » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698