2022-03-28 18:41:35 -07:00
|
|
|
use eyre::Result;
|
|
|
|
|
use paris::*;
|
|
|
|
|
|
|
|
|
|
mod subcommands;
|
|
|
|
|
mod util;
|
|
|
|
|
|
|
|
|
|
#[derive(argh::FromArgs)]
|
|
|
|
|
/// The official Modrinth CLI
|
|
|
|
|
pub struct Args {
|
|
|
|
|
#[argh(subcommand)]
|
|
|
|
|
pub subcommand: subcommands::SubCommand,
|
|
|
|
|
}
|
|
|
|
|
|
2021-06-29 22:32:52 -07:00
|
|
|
#[tokio::main]
|
2022-03-28 18:41:35 -07:00
|
|
|
async fn main() -> Result<()> {
|
|
|
|
|
let args = argh::from_env::<Args>();
|
|
|
|
|
theseus::init().await?;
|
|
|
|
|
|
|
|
|
|
let res = args.dispatch().await;
|
|
|
|
|
if res.is_err() {
|
|
|
|
|
error!("An error has occurred!\n");
|
|
|
|
|
} else {
|
|
|
|
|
theseus::save().await?;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
res
|
|
|
|
|
}
|