You are an expert in writing code in many different languages. Your goal is to perform code completion for the following code, keeping in mind the rest of the code and the file meta data.
    Metadata details:
    filename: generate.rs
    path of file: ./repos/cargo-about/src/cargo-about
    
    the code of the file until where you have to start completion: use anyhow::Context as _;
use cargo_about::licenses;
use cargo_about::licenses::LicenseInfo;
use codespan_reporting::term;
use krates::cm::Package;
use krates::{Utf8Path as Path, Utf8PathBuf as PathBuf};
use serde::Serialize;
use std::{collections::BTreeMap, fmt};

#[derive(clap::ValueEnum, Copy, Clone, Debug, Default)]
pub enum OutputFormat {
    /// Uses one or more handlebars templates to transform JSON to the output
    #[default]
    Handlebars,
    /// Outputs the raw JSON of the discovered licenses
    Json,
}

impl fmt::Display for OutputFormat {
    fn fmt(&self, f: &mut fmt::Formatter<'_>) -> fmt::Result {
        match self {
            Self::Handlebars => f.write_str("handlebars"),
            Self::Json => f.write_str("json"),
        }
    }
}

#[derive(clap::Parser, Debug)]
pub struct Args {
    /// Path to the config to use
    ///
    /// Defaults to <manifest_root>/about.toml if not specified
    #[clap(short, long)]
    config: Option<PathBuf>,
    /// The confidence threshold required for license files
    /// to be positively identified: 0.0 - 1.0
    #[clap(long, default_value = "0.8")]
    threshold: f32,
    /// The name of the template to use when renderin
    
fn load_config(manifest_path: &Path) -> anyhow::Result<cargo_about::licenses::config::Config> {
    let mut parent = manifest_path.parent();

    // Move up directories until we find an about.toml, to handle
    // cases where eg in a workspace there is a top-level about.toml
    // but the user is only getting a listing for a particular crate from it
    while let Some(p) = parent {
        // We _could_ limit ourselves to only directories that also have a Cargo.toml
        // in them, but there could be cases where someone has multiple
        // rust projects in subdirectories with a single top level about.toml that is
        // used across all of them, we could also introduce a metadata entry for the
        // relative path of the about.toml to use for the crate/workspace

        // if !p.join("Cargo.toml").exists() {
        //     parent = p.parent();
        //     continue;
        // }

        let about_toml = p.join("about.toml");

        if about_toml.exists() {
            let contents = std::fs::read_to_string(&about_toml)?;
            let cfg = toml::from_str(&contents)?;

            log::info!("loaded config from '{about_toml}'");
            return Ok(cfg);
        }

        parent = p.parent();
    }

    log::warn!("no 'about.toml' found, falling back to default configuration");
    Ok(cargo_about::licenses::config::Config::default())
}