зеркало из https://github.com/mozilla/gecko-dev.git
Bug 1814240: move mach pastebin description to docstring r=ahochheiden
The description in the docstring will be shown for `mach help pastebin`, and the shorter description in the command decorator will be shown in the list of useful mach commands. Differential Revision: https://phabricator.services.mozilla.com/D168466
This commit is contained in:
Родитель
6e992536ac
Коммит
e0656d7178
|
@ -218,17 +218,12 @@ PASTEMO_MAX_CONTENT_LENGTH = 250 * 1024 * 1024
|
|||
|
||||
PASTEMO_URL = "https://paste.mozilla.org/api/"
|
||||
|
||||
MACH_PASTEBIN_DESCRIPTION = """
|
||||
Command line interface to paste.mozilla.org.
|
||||
|
||||
Takes either a filename whose content should be pasted, or reads
|
||||
content from standard input. If a highlighter is specified it will
|
||||
be used, otherwise the file name will be used to determine an
|
||||
appropriate highlighter.
|
||||
"""
|
||||
|
||||
|
||||
@Command("pastebin", category="misc", description=MACH_PASTEBIN_DESCRIPTION)
|
||||
@Command(
|
||||
"pastebin",
|
||||
category="misc",
|
||||
description="Command line interface to paste.mozilla.org.",
|
||||
)
|
||||
@CommandArgument(
|
||||
"--list-highlighters",
|
||||
action="store_true",
|
||||
|
@ -255,6 +250,14 @@ appropriate highlighter.
|
|||
help="Path to file for upload to paste.mozilla.org",
|
||||
)
|
||||
def pastebin(command_context, list_highlighters, highlighter, expires, verbose, path):
|
||||
"""Command line interface to `paste.mozilla.org`.
|
||||
|
||||
Takes either a filename whose content should be pasted, or reads
|
||||
content from standard input. If a highlighter is specified it will
|
||||
be used, otherwise the file name will be used to determine an
|
||||
appropriate highlighter.
|
||||
"""
|
||||
|
||||
import requests
|
||||
|
||||
def verbose_print(*args, **kwargs):
|
||||
|
|
Загрузка…
Ссылка в новой задаче