mirror of
https://gitlab.winehq.org/wine/wine-gecko.git
synced 2024-09-13 09:24:08 -07:00
Bug 846409 - Add |mach mach-debug-commands|; r=jhammel
DONTBUILD (NPOTB)
This commit is contained in:
parent
9376d7ad68
commit
eeedb5018f
@ -31,6 +31,7 @@ SEARCH_PATHS = [
|
||||
MACH_MODULES = [
|
||||
'addon-sdk/mach_commands.py',
|
||||
'layout/tools/reftest/mach_commands.py',
|
||||
'python/mach/mach/commands/commandinfo.py',
|
||||
'python/mozboot/mozboot/mach_commands.py',
|
||||
'python/mozbuild/mozbuild/config.py',
|
||||
'python/mozbuild/mozbuild/mach_commands.py',
|
||||
|
35
python/mach/mach/commands/commandinfo.py
Normal file
35
python/mach/mach/commands/commandinfo.py
Normal file
@ -0,0 +1,35 @@
|
||||
# This Source Code Form is subject to the terms of the Mozilla Public
|
||||
# License, v. 2.0. If a copy of the MPL was not distributed with this
|
||||
# file, # You can obtain one at http://mozilla.org/MPL/2.0/.
|
||||
|
||||
from __future__ import print_function, unicode_literals
|
||||
|
||||
from mach.decorators import (
|
||||
CommandProvider,
|
||||
Command,
|
||||
)
|
||||
|
||||
|
||||
@CommandProvider
|
||||
class BuiltinCommands(object):
|
||||
def __init__(self, context):
|
||||
self.context = context
|
||||
|
||||
@Command('mach-debug-commands', help='Show info about available mach commands.')
|
||||
def commands(self):
|
||||
import inspect
|
||||
|
||||
handlers = self.context.commands.command_handlers
|
||||
for command in sorted(handlers.keys()):
|
||||
handler = handlers[command]
|
||||
cls = handler.cls
|
||||
method = getattr(cls, getattr(handler, 'method'))
|
||||
|
||||
print(command)
|
||||
print('=' * len(command))
|
||||
print('')
|
||||
print('File: %s' % inspect.getsourcefile(method))
|
||||
print('Class: %s' % cls.__name__)
|
||||
print('Method: %s' % handler.method)
|
||||
print('')
|
||||
|
Loading…
Reference in New Issue
Block a user