

@click.command(context_settings=command_settings)
@click.option('--executable', '-x', default='default', help='Command to run  [default: nova]', show_default=False)
@click.option('--debug', '-d', default=False, is_flag=True, help='Enable debugging', show_default=True)
@click.option('--conf', '-c', default=None, is_flag=False, help='Manually specify a supernova configuration file')
@click.option('--quiet', '-q', default=False, show_default=False, is_flag=True, help='Display the least amount of output possible')
@click.option('--echo', '-e', default=None, is_flag=True, help='Print the specified environment and exit')
@click.argument('environment', nargs=1)
@click.argument('command', nargs=(- 1))
@click.version_option()
@click.option('--list', '-l', is_flag=True, callback=print_env_list, expose_value=False, is_eager=False, default=False, help='List all configured environments')
@click.option('--shortlist', '-s', is_flag=True, callback=print_env_short_list, expose_value=False, is_eager=False, default=False, help='List all configured environments in shorter format')
@click.pass_context
def run_supernova(ctx, executable, debug, quiet, environment, command, conf, echo):
    "\n    You can use supernova with many OpenStack clients and avoid the pain of\n    managing multiple sets of environment variables.  Getting started is easy\n    and there's some documentation that can help:\n\n      http://supernova.readthedocs.org/\n\n    The first step is to get your environment variables packed into a\n    configuration file, usually in ~/.supernova.  The docs (linked above) have\n    some good examples that you can fill in via copy/paste.\n\n    Once you have a configuration ready to go, replace 'prod' below with one\n    of your configured environments and try some of these commands:\n\n      supernova prod list                 (Lists instances via novaclient)\n      supernova prod image-list           (Lists images via novaclient)\n      supernova prod boot ...             (Boots an instance via novaclient)\n\n    Have questions, bugs, or comments?  Head on over to Github and open an\n    issue or submit a pull request!\n\n      https://github.com/major/supernova\n    "
    try:
        nova_creds = config.run_config(config_file_override=conf)
    except Exception as e:
        msg = "\n  There's an error in your configuration file:\n\n    {0}\n".format(e)
        click.echo(msg)
        ctx.exit(1)
    utils.check_environment_presets()
    if utils.is_valid_group(environment, nova_creds):
        envs = utils.get_envs_in_group(environment, nova_creds)
    else:
        envs = [environment]
    supernova_args = {
        'debug': debug,
        'executable': executable,
        'quiet': quiet,
        'echo': echo,
    }
    if ((len(envs) == 1) and (not utils.is_valid_environment(envs[0], nova_creds))):
        msg = "\nCouldn't find an environment called '{0}' in your configuration file.\nTry supernova --list to see all configured environments.\n".format(nova_args[0])
        click.echo(msg)
        ctx.exit(1)
    if supernova_args['echo']:
        if (len(envs) > 1):
            msg = "\nCan't echo a group of environments.\nSpecify a single environment when using --echo."
            click.echo(msg)
            ctx.exit(1)
        env = credentials.prep_shell_environment(envs[0], nova_creds)
        for k in env:
            click.echo('{0}={1}'.format(k, env[k]))
        ctx.exit(0)
    if (len(command) == 0):
        msg = '\nMissing arguments to pass to executable  Run supernova --help for examples.\n'.format(envs[0])
        click.echo(msg)
        ctx.exit(1)
    nova_args = list(command)
    for env in envs:
        supernova_args['nova_env'] = env
        returncode = supernova.run_command(nova_creds, nova_args, supernova_args)
    sys.exit(returncode)

dataset/ETHPy150Open major/supernova/supernova/executable.py run_supernova/VarMisuse@410/1018 `envs`->`nova_args`