From b26c9db78299f5eda77af21afcd4a07bb5e111f1 Mon Sep 17 00:00:00 2001 From: liuchang0812 Date: Sat, 8 Jul 2017 12:50:38 +0800 Subject: [PATCH] tool/ceph: print timeout tips iff verbose Signed-off-by: liuchang0812 --- src/ceph.in | 12 +++++++----- 1 file changed, 7 insertions(+), 5 deletions(-) diff --git a/src/ceph.in b/src/ceph.in index a17a4cd4b23e..c9bef561e45d 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" -- 2.47.3