zenyx-engine/xtask/src/main.rs
Jason Spalti 536302b0cd
Refactor logging system to switch between stdout and file logging
* Refactor logging to switch between stdout and file logging

* Use "clear" instead of "tput reset" for unix

* Remove redundant comments
2025-04-21 19:15:16 -04:00

62 lines
1.4 KiB
Rust

use clap::{CommandFactory, Parser, Subcommand, ValueEnum};
pub mod editor;
pub mod engine;
#[derive(Parser)]
#[command(version, about, long_about = None,disable_version_flag = true,disable_help_flag = true)]
struct Cli {
#[arg(short, long)]
release: bool,
#[command(subcommand)]
command: Option<Commands>,
}
#[derive(Subcommand)]
enum Commands {
Run {
#[arg()]
task: Task,
},
Config,
}
#[derive(Clone, ValueEnum)]
enum Task {
Engine, // Builds both editor and core
Editor, // Builds editor only
Core, // Builds engine core only
Help,
}
fn main() {
let cli = Cli::parse();
if cli.release {
println!("Running in release mode")
}
match &cli.command {
None => {
Cli::command()
.print_help()
.map_err(|e| {
println!("Could not run Xtask: {e}");
})
.unwrap();
}
Some(Commands::Run { task }) => match task {
Task::Engine => engine::build_engine(),
Task::Editor => todo!("Editor is not being actively worked on"),
Task::Core => {
engine::build_core();
}
Task::Help => {
println!("The following options are avalible to run");
todo!()
}
},
Some(Commands::Config) => {
todo!()
}
}
}