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

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: Changed variable name 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..a9ebae098d49babcd3693ea6a1a570b75cc10e50 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]
+ name_to_dash = name_asked.replace('_', '-')
+ if name_to_dash in commands:
+ return commands[name_to_dash]
# 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