From 29404b59d2c92077b8f729c441d148f45d89396a Mon Sep 17 00:00:00 2001 From: "maruel@chromium.org" Date: Mon, 8 Sep 2014 22:58:00 +0000 Subject: [PATCH] Add git cl lol. Because everyone needs humour. Fix a small bug in subcommands.py with undocumented commands. R=stip@chromium.org BUG= Review URL: https://codereview.chromium.org/554123003 git-svn-id: svn://svn.chromium.org/chrome/trunk/tools/depot_tools@291867 0039d316-1c4b-4281-b951-d872f2087c98 --- git_cl.py | 23 +++++++++++++++++++++++ subcommand.py | 2 +- 2 files changed, 24 insertions(+), 1 deletion(-) diff --git a/git_cl.py b/git_cl.py index b13dc4d0c..a9b237652 100755 --- a/git_cl.py +++ b/git_cl.py @@ -2775,6 +2775,29 @@ def CMDformat(parser, args): return 0 +def CMDlol(parser, args): + # This command is intentionally undocumented. + print(""" / / + (\/_//`) + / '/ + 0 0 \ + / \ + / __/ \ + /, _/ \ \_ + `-./ ) | ~^~^~^~^~^~^~^~\~. + ( / \_} + | / | + ; | \ / + \/ ,/ \ | + / /~~|~|~~~~~~|~|\ | + / / | | | | `\ \ + / / | | | | \ \ + / ( | | | | \ \ + jgs /,_) /__) /__) /,_/ + '''''"""""'''""""""'''""""""''"""""''''' """) + return 0 + + class OptionParser(optparse.OptionParser): """Creates the option parse and add --verbose support.""" def __init__(self, *args, **kwargs): diff --git a/subcommand.py b/subcommand.py index 0b0fa6e30..b6f8e5cd5 100644 --- a/subcommand.py +++ b/subcommand.py @@ -192,7 +192,7 @@ class CommandDispatcher(object): rest = textwrap.dedent('\n'.join(lines[1:])) parser.description = '\n'.join((lines[0], rest)) else: - parser.description = lines[0] + parser.description = lines[0] if lines else '' if parser.description: parser.description += '\n' parser.epilog = getattr(command, 'epilog', None)