From: liuchang0812 Date: Sat, 8 Jul 2017 04:50:38 +0000 (+0800) Subject: tool/ceph: print timeout tips iff verbose X-Git-Tag: v12.1.1~86^2~1 X-Git-Url: http://git-server-git.apps.pok.os.sepia.ceph.com/?a=commitdiff_plain;h=b26c9db78299f5eda77af21afcd4a07bb5e111f1;p=ceph.git tool/ceph: print timeout tips iff verbose Signed-off-by: liuchang0812 --- diff --git a/src/ceph.in b/src/ceph.in index a17a4cd4b23..c9bef561e45 100755 --- a/src/ceph.in +++ b/src/ceph.in @@ -886,10 +886,7 @@ def main(): if not timeout: timeout = 5 - hdr('Monitor commands:') - print('[Contacting monitor, timeout after %d seconds]' % timeout) - - if childargs and childargs[0] == 'ping': + if childargs and childargs[0] == 'ping' and not parsed_args.help: if len(childargs) < 2: print('"ping" requires a monitor name as argument: "ping mon."', file=sys.stderr) return 1 @@ -897,7 +894,7 @@ def main(): # for completion let timeout be really small timeout = 3 try: - if childargs and childargs[0] == 'ping': + if childargs and childargs[0] == 'ping' and not parsed_args.help: return ping_monitor(cluster_handle, childargs[1], timeout) run_in_thread(cluster_handle.connect, timeout=timeout) except KeyboardInterrupt: @@ -909,7 +906,12 @@ def main(): except Exception as e: print(str(e), file=sys.stderr) return 1 + if parsed_args.help: + hdr('Monitor commands:') + if verbose: + print('[Contacting monitor, timeout after %d seconds]' % timeout) + return do_extended_help(parser, childargs, ('mon', ''), ' '.join(childargs)) # implement "tell service.id help"