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

Unified Diff: subcommand.py

Issue 1066923003: Automatically upgrade '_' to '-' when finding the right command. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/tools/depot_tools
Patch Set: Created 5 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 | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: subcommand.py
diff --git a/subcommand.py b/subcommand.py
index 0201c90aa35d61a17252fd4eeb1e227bd76375d3..79dcb7ac3e759158a308f265c089bf5b11018342 100644
--- a/subcommand.py
+++ b/subcommand.py
@@ -128,8 +128,9 @@ class CommandDispatcher(object):
and/or incomplete names.
"""
commands = self.enumerate_commands()
- if name_asked in commands:
- return commands[name_asked]
+ underscore = name_asked.replace('_', '-')
ghost stip (do not use) 2015/04/07 16:50:18 maybe rename to 'underscored' or something?
M-A Ruel 2015/04/07 17:07:14 'underscored or something' is not a valid python s
+ if underscore in commands:
+ return commands[underscore]
# An exact match was not found. Try to be smart and look if there's
# something similar.
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698