Runs bang with optional list of strings as command line options.

    If ``alt_args`` is not specified, defaults to parsing ``sys.argv`` for
    command line options.

def run_bang(alt_args=None):
    """
    Runs bang with optional list of strings as command line options.

    If ``alt_args`` is not specified, defaults to parsing ``sys.argv`` for
    command line options.
    """
    parser = get_parser()
    args = parser.parse_args(alt_args)

    source = args.config_specs or get_env_configs()
    if not source:
        return

    config = Config.from_config_specs(source)

    if args.playbooks:
        config[A.PLAYBOOKS] = args.playbooks

    if args.dump_config:

        if args.dump_config in ('yaml', 'yml'):
            import yaml
            print yaml.safe_dump(dict(config))
        elif args.dump_config == 'json':
            import json
            print json.dumps(config)
        else:
            print config
        sys.exit()

    set_ssh_creds(config, args)

    annoy(config)

    stack = Stack(config)

    if args.ansible_list:
        stack.show_inventory(
                os.isatty(sys.stdout.fileno())
                )
        return

    initialize_logging(config)
    # TODO:  config.validate()
    if args.deploy:
        stack.deploy()
    if args.configure:
        stack.configure()
    config.autoinc()