def cli_main()

in roles/gcs-upload/library/gcs_upload.py [0:0]


def cli_main():
    parser = argparse.ArgumentParser(
        description="Upload files to Google Cloud Storage"
    )
    parser.add_argument('--verbose', action='store_true',
                        help='show debug information')
    parser.add_argument('--credentials-file',
                        help='A file with Google Cloud credentials')
    parser.add_argument('--project',
                        help='Name of the Google Cloud project (required for '
                             'credential file)')
    parser.add_argument('container',
                        help='Name of the container to use when uploading')
    parser.add_argument('prefix',
                        help='The prefix under the container root')
    parser.add_argument('cache_control',
                        help='The cache-control header to set')
    parser.add_argument('root',
                        help='The root of the directory to upload')

    args = parser.parse_args()

    if args.verbose:
        logging.basicConfig(level=logging.DEBUG)
        logging.captureWarnings(True)

    file_list = run(args.container, args.prefix, args.root,
                    credentials_file=args.credentials_file,
                    project=args.project,
                    cache_control=args.cache_control)