summaryrefslogtreecommitdiffstats
path: root/src/handler/info.rs
blob: 4ace98d05878b70944c430d667cc74bf616658d4 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
use crate::filesystem;
use crate::fs::pathbuf_to_string;
use anyhow::Result;

#[derive(Debug)]
pub enum Info {
    CheatsPath,
    ConfigPath,
    ConfigExample,
}

pub fn main(info: &Info) -> Result<()> {
    match info {
        Info::CheatsPath => println!("{}", pathbuf_to_string(&filesystem::default_cheat_pathbuf()?)?),
        Info::ConfigPath => println!("{}", pathbuf_to_string(&filesystem::default_config_pathbuf()?)?),
        Info::ConfigExample => println!("{}", include_str!("../../docs/config_file_example.yaml")),
    }
    Ok(())
}