1use clap::Parser;
5
6pub mod args;
7pub mod commands;
8
9pub use args::{Cli, Commands, GlobalArgs, TaskAction};
10
11pub fn run() -> Result<(), Box<dyn std::error::Error>> {
13 let cli = Cli::parse();
14
15 setup_logging(&cli.global)?;
17
18 match cli.command {
20 Commands::Install {
21 target,
22 force,
23 template,
24 } => commands::install::run(&cli.global, target, force, template),
25 Commands::Status {
26 detailed,
27 project,
28 } => commands::status::run(&cli.global, detailed, project),
29 Commands::Context { workspace, project } => {
30 commands::context::run(&cli.global, workspace, project)
31 }
32 Commands::Tasks { action } => commands::tasks::run(&cli.global, action),
33 }
34}
35
36fn setup_logging(global: &GlobalArgs) -> Result<(), Box<dyn std::error::Error>> {
38 if global.no_color {
40 colored::control::set_override(false);
41 }
42
43 Ok(())
47}