1use clap::Parser;
2use commands::{Command, CommandRunner, PluginSubcommand, SwcCliOptions};
3
4mod commands;
5mod util;
6
7pub fn run() -> anyhow::Result<()> {
8 let command = SwcCliOptions::parse().command;
9
10 match &command {
11 Command::Plugin(PluginSubcommand::New(options)) => options.execute(),
12 Command::Compile(options) => options.execute(),
13 Command::Minify(options) => options.execute(),
14 Command::Bundle(options) => options.execute(),
15 Command::Lint(options) => options.execute(),
16 }
17}