def subcmd_bundle_clone(config, cargs):
    catalog = get_catalog(config, cargs)
    bundle_name = cargs.bundle
    bundle_id = helpers.make_bundle_id(catalog.id, bundle_name)
    version = parse_single_version_ish(catalog, bundle_name, cargs.version)
    flavor = cargs.flavor
    root_path = cargs.path

    if cargs.no_versions:
        bundle_dir_name = bundle_id
    else:
        bundle_dir_name = None

    client.clone_bundle(catalog, bundle_name, version, root_path=root_path,
                        bundle_dir_name=bundle_dir_name, flavor=flavor)

    if cargs.include_manifest:
        if cargs.no_versions:
            manifest_name = '%s.json' % (bundle_id)
        else:
            manifest_name = '%s.json' % (helpers.make_bundle_descriptor(bundle_id, version))

        manifest_dest_path = os.path.join(root_path, manifest_name)
        manifest_src_path = catalog.path_helper.path_for_manifest_for_bundle_version(bundle_name, version)
        _dump_json(catalog, manifest_src_path, dest_path=manifest_dest_path)
dataset/ETHPy150Open mindsnacks/Zinc/src/zinc/cli.py/subcmd_bundle_clone/original