Commit 9d12b180 authored by Theophile GENTILHOMME's avatar Theophile GENTILHOMME
Browse files

[scripts][main_cli] Add options to the main beat command

Add configuration related options to the main beat command group. The
values of these command  are then saved in the context (ctx) and passed
to the subcommands.
parent 79b4a5aa
......@@ -10,13 +10,37 @@ from ..config import Configuration
@with_plugins(pkg_resources.iter_entry_points('beat.cli'))
@click.group()
@click.option('--test-mode/--no-test-mode', default=False)
@click.option('-T', '--test-mode', help='Assume test mode and doesn\'t setup '
'the logging module', default=False, is_flag=True)
@click.option('-V', '--version', help='Show version', is_flag=True)
@click.option('-p', '--prefix',
help='Overrides the prefix of your local data. '
'If not set use the value from your RC file',
type=click.STRING)
@click.option('-c', '--cache',
help='Overrides the cache prefix. If not set, use the value '
'from your RC file', type=click.STRING)
@click.option('-t', '--token', help='Overrides the user token for server '
'operations. If not set, use the value from your RC file.',
type=click.STRING)
@click.option('-u', '--user', help='Overrides the user name on the remote '
'platform. If not set, use the value from your RC file.',
type=click.STRING)
@click.option('-m', '--platform', help='The URL of the BEAT platform to '
'access.', type=click.STRING)
@verbosity_option()
@click.pass_context
def main(ctx, test_mode):
def main(ctx, test_mode, version, prefix, cache, user, token, platform):
"""The main command line interface for beat cmdline. Look below for available
commands."""
ctx.meta['--version'] = version
ctx.meta['--prefix'] = prefix
ctx.meta['--cache'] = cache
ctx.meta['--user'] = user
ctx.meta['--token'] = token
ctx.meta['--platform'] = platform
# Check that we are in a BEAT working folder
config = Configuration(ctx.meta)
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment