2022-03-28 18:41:35 -07:00
|
|
|
use eyre::Result;
|
2022-04-10 13:14:53 -07:00
|
|
|
use futures::TryFutureExt;
|
2022-03-28 18:41:35 -07:00
|
|
|
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?;
|
|
|
|
|
|
2022-04-10 13:14:53 -07:00
|
|
|
args.dispatch()
|
|
|
|
|
.inspect_err(|_| error!("An error has occurred!\n"))
|
|
|
|
|
.and_then(|_| async { Ok(theseus::save().await?) })
|
|
|
|
|
.await
|
2022-03-28 18:41:35 -07:00
|
|
|
}
|