From 438f63fac2bcbb0f21de9c363a8cf0fb5dd221a2 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?S=C3=A9bastien=20Helleu?= Date: Thu, 8 May 2014 18:13:15 +0200 Subject: [PATCH] Rename option -v/--verbose to -d/--debug, add option -v/--version in qweechat-testproto --- qweechat/weechat/testproto.py | 13 ++++++++----- 1 file changed, 8 insertions(+), 5 deletions(-) diff --git a/qweechat/weechat/testproto.py b/qweechat/weechat/testproto.py index 936fba9..afcb80c 100644 --- a/qweechat/weechat/testproto.py +++ b/qweechat/weechat/testproto.py @@ -37,6 +37,7 @@ import time import traceback import protocol # WeeChat/relay protocol +from .. version import qweechat_version NAME = 'qweechat-testproto' @@ -93,10 +94,10 @@ class TestProto(object): try: proto = protocol.Protocol() msgd = proto.decode(message, - separator='\n' if self.args.verbose > 0 + separator='\n' if self.args.debug > 0 else ', ') print('') - if self.args.verbose >= 2 and msgd.uncompressed: + if self.args.debug >= 2 and msgd.uncompressed: # display raw message print('\x1b[32m--> message uncompressed ({0} bytes):\n' '{1}\x1b[0m' @@ -215,9 +216,11 @@ The script returns: '''.format(name=NAME)) parser.add_argument('-6', '--ipv6', action='store_true', help='connect using IPv6') - parser.add_argument('-v', '--verbose', action='count', default=0, - help='verbose mode: long objects view ' - '(-vv: display raw messages)') + parser.add_argument('-d', '--debug', action='count', default=0, + help='debug mode: long objects view ' + '(-dd: display raw messages)') + parser.add_argument('-v', '--version', action='version', + version=qweechat_version()) parser.add_argument('hostname', help='hostname (or IP address) of machine running ' 'WeeChat/relay')