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
experimental/szager/collated-output
maruel@chromium.org 12 years ago
parent 1580d959c3
commit 89f91d417f

@ -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]

Loading…
Cancel
Save