pub fn get_docs_help<Output: Write>(cmd: &str, config: &Config, output: &mut Output) -> Result<()> {
    const MAN_PAGE: usize = 0;
    const CHEAT_SHEET: usize = 1;
    const EG_PAGE: usize = 2;
    const CHEATSHEETS: usize = 3;
    let menu_options = [
        "Show man page",
        "Show cheat.sh page",
        "Show the eg page",
        "Show the cheatsheet page",
        "Exit",
    ];
    let mut selection = Some(MAN_PAGE);
    loop {
        selection = Select::with_theme(&get_selection_theme())
            .with_prompt("Select operation")
            .default(selection.unwrap_or_default())
            .items(&menu_options)
            .interact_on_opt(&Term::stderr())?;
        if let Some(MAN_PAGE) = selection {
            show_man_page(&config.man_command, cmd)?
        } else {
            let page = match selection {
                Some(CHEAT_SHEET) => CheatDotSh.fetch(cmd, &config.cheat_sh_url)?,
                Some(EG_PAGE) => Eg.fetch(cmd, &config.eg_url)?,
                Some(CHEATSHEETS) => Cheatsheets.fetch(cmd, &config.cheatsheets_url)?,
                _ => return Ok(()),
            };
            // Show the page using the user selected pager or write it directly into the output
            if let Some(pager) = config.pager_command.as_ref() {
                let mut process = if cfg!(target_os = "windows") {
                    Command::new("cmd")
                        .args(["/C", pager])
                        .stdin(Stdio::piped())
                        .spawn()
                } else {
                    Command::new("sh")
                        .args(["-c", pager])
                        .stdin(Stdio::piped())
                        .spawn()
                }?;
                if let Some(stdin) = process.stdin.as_mut() {
                    writeln!(stdin, "{}", page)?;
                    process.wait()?;
                }
            } else {
                writeln!(output, "{}", page)?;
            }
        }
    }
}
Shows documentation/usage help about the given command.
src/helper/docs/mod.rs