use clap::{Parser,Subcommand};
use anyhow::Result as AResult;

#[derive(Parser)]
#[command(author,version,about,long_about=None)]
#[command(propagate_version=true)]
struct Cli{
	#[command(subcommand)]
	command:Commands,
}

#[derive(Subcommand)]
enum Commands{
	#[command(flatten)]
	#[cfg(feature="roblox")]
	Roblox(map_tool::roblox::Commands),
	#[command(flatten)]
	#[cfg(feature="source")]
	Source(map_tool::source::Commands),
}

#[tokio::main]
async fn main()->AResult<()>{
	let cli=Cli::parse();
	match cli.command{
		#[cfg(feature="roblox")]
		Commands::Roblox(commands)=>commands.run().await,
		#[cfg(feature="source")]
		Commands::Source(commands)=>commands.run().await,
	}
}
