summaryrefslogtreecommitdiffstats
path: root/src/main.rs
blob: 3caf1aea20271bb3de52ffbb1d6fb152374cb01e (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
use anyhow::Result;

pub mod cli;
pub mod client;
mod commands;
pub mod config;
pub mod consts;
pub mod ipfs_client;
pub mod profile;
pub mod types;
mod gui;

fn main() -> Result<()> {
    let _ = env_logger::try_init()?;
    let matches = crate::cli::app().get_matches();

    match matches.subcommand() {
        Some(("profile", matches)) => crate::commands::profile(matches).await,
        Some(("gui", _)) => crate::gui::run(),
        Some((other, _)) => {
            log::error!("No subcommand {} implemented", other);
            Ok(())
        },

        _ => {
            log::error!("Don't know what to do");
            Ok(())
        },
    }
}