Add quiet option to CLI

Closes #99
This commit is contained in:
Joshua Boniface 2020-06-25 11:09:55 -04:00
parent 15e986c158
commit d74f68c904
1 changed files with 16 additions and 11 deletions

View File

@ -3492,7 +3492,11 @@ def init_cluster(confirm_flag):
'-v', '--debug', '_debug', envvar='PVC_DEBUG', is_flag=True, default=False, '-v', '--debug', '_debug', envvar='PVC_DEBUG', is_flag=True, default=False,
help='Additional debug details.' help='Additional debug details.'
) )
def cli(_cluster, _debug): @click.option(
'-q', '--quiet', '_quiet', envvar='PVC_QUIET', is_flag=True, default=False,
help='Suppress cluster connection information.'
)
def cli(_cluster, _debug, _quiet):
""" """
Parallel Virtual Cluster CLI management tool Parallel Virtual Cluster CLI management tool
@ -3510,16 +3514,17 @@ def cli(_cluster, _debug):
if not config.get('badcfg', None): if not config.get('badcfg', None):
config['debug'] = _debug config['debug'] = _debug
click.echo( if not _quiet:
'Using cluster "{}" - Host: "{}" Scheme: "{}" Prefix: "{}"'.format( click.echo(
config['cluster'], 'Using cluster "{}" - Host: "{}" Scheme: "{}" Prefix: "{}"'.format(
config['api_host'], config['cluster'],
config['api_scheme'], config['api_host'],
config['api_prefix'] config['api_scheme'],
), config['api_prefix']
err=True ),
) err=True
click.echo('', err=True) )
click.echo('', err=True)
config = dict() config = dict()