Add transparent dash support to commands.

This makes it easier to type without using the shift-key, so an user can type
'git cl set-commit' and it'll find CMDset_commit.

R=xusydoc@chromium.org
BUG=

Review URL: https://chromiumcodereview.appspot.com/22918019

git-svn-id: svn://svn.chromium.org/chrome/trunk/tools/depot_tools@219054 0039d316-1c4b-4281-b951-d872f2087c98
diff --git a/subcommand.py b/subcommand.py
index 6afe3dc..0b0fa6e 100644
--- a/subcommand.py
+++ b/subcommand.py
@@ -119,6 +119,9 @@
     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]