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

Unified Diff: subcommand.py

Issue 22918019: Add transparent dash support to commands. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/tools/depot_tools
Patch Set: Created 7 years, 4 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 6afe3dcda1d31b458174f97c491dcf4ab0fb68d7..0b0fa6e30206d9495c004420aede869b8922f685 100644
--- a/subcommand.py
+++ b/subcommand.py
@@ -119,6 +119,9 @@ class CommandDispatcher(object):
It automatically tries to guess the intended command by handling typos or
incomplete names.
"""
+ # Implicitly replace foo-bar to foo_bar since foo-bar is not a valid python
+ # symbol but it's faster to type.
+ name = name.replace('-', '_')
commands = self.enumerate_commands()
if name in commands:
return commands[name]
« 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