use std::io;
use clap::{Parser, Subcommand};
pub mod commands;
pub mod repl;
#[derive(Parser, Debug)]
#[command(name = "ralix", about = "Command line interface for ralix", version)]
pub struct Cli {
#[command(subcommand)]
pub command: Commands,
}
#[derive(Debug, Subcommand)]
pub enum Commands {
Run(commands::run::RunArguments),
Repl(commands::repl::REPLArguments),
Ast(commands::ast::AstArguments),
Init(commands::init::InitArguments),
Meow,
}
impl Cli {
pub fn run(self) -> io::Result<()> {
match self.command {
Commands::Run(run_args) => commands::run::run(run_args),
Commands::Repl(repl_args) => commands::repl::run(repl_args),
Commands::Ast(ast_args) => commands::ast::run(ast_args),
Commands::Init(init_args) => commands::init::run(init_args),
Commands::Meow => commands::meow::run(),
}
}
}