1mod tasks;
2mod workspace;
3
4use anyhow::Result;
5use clap::{Parser, Subcommand};
6
7#[derive(Parser)]
8#[command(name = "cargo xtask")]
9struct Args {
10 #[command(subcommand)]
11 command: CliCommand,
12}
13
14#[derive(Subcommand)]
15enum CliCommand {
16 /// Runs `cargo clippy`.
17 Clippy(tasks::clippy::ClippyArgs),
18 Licenses(tasks::licenses::LicensesArgs),
19}
20
21fn main() -> Result<()> {
22 let args = Args::parse();
23
24 match args.command {
25 CliCommand::Clippy(args) => tasks::clippy::run_clippy(args),
26 CliCommand::Licenses(args) => tasks::licenses::run_licenses(args),
27 }
28}