mirror of
https://chromium.googlesource.com/chromium/tools/depot_tools.git
synced 2026-01-11 18:51:29 +00:00
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
This commit is contained in:
@@ -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]
|
||||
|
||||
Reference in New Issue
Block a user