use clap::Parser;
use colored::Colorize;
#[derive(Debug, Parser)]
#[command(name = "println")]
struct Cli {
#[command(subcommand)]
command: Commands,
}
#[derive(Debug, Parser)]
enum Commands {
#[command(arg_required_else_help = true)]
Black {
msg: String,
},
#[command(arg_required_else_help = true)]
Blue {
msg: String,
},
#[command(arg_required_else_help = true)]
Cyan {
msg: String,
},
#[command(arg_required_else_help = true)]
Magenta {
msg: String,
},
#[command(arg_required_else_help = true)]
Msg {
msg: String,
},
#[command(arg_required_else_help = true)]
Green {
msg: String,
},
#[command(arg_required_else_help = true)]
Red {
msg: String,
},
#[command(arg_required_else_help = true)]
Yellow {
msg: String,
},
}
fn main() {
let args = Cli::parse();
match args.command {
Commands::Black { msg } => println!("{}", msg.black()),
Commands::Blue { msg } => println!("{}", msg.blue()),
Commands::Cyan { msg } => println!("{}", msg.cyan()),
Commands::Magenta { msg } => println!("{}", msg.magenta()),
Commands::Msg { msg } => println!("{}", msg),
Commands::Green { msg } => println!("{}", msg.green()),
Commands::Red { msg } => println!("{}", msg.red()),
Commands::Yellow { msg } => println!("{}", msg.yellow()),
}
}