1use clap::{Parser, Subcommand};
4
5#[derive(Parser)]
6#[command(name = "warcraft-rs")]
7#[command(about = "Command-line tools for World of Warcraft file formats", long_about = None)]
8#[command(version)]
9#[command(author)]
10pub struct Cli {
11 #[command(subcommand)]
13 pub command: Commands,
14
15 #[arg(short, long, action = clap::ArgAction::Count, global = true)]
17 pub verbose: u8,
18
19 #[arg(short, long, global = true)]
21 pub quiet: bool,
22}
23
24#[derive(Subcommand)]
25pub enum Commands {
26 #[cfg(feature = "mpq")]
28 Mpq {
29 #[command(subcommand)]
30 command: crate::commands::mpq::MpqCommands,
31 },
32
33 #[cfg(feature = "dbc")]
35 Dbc {
36 #[command(subcommand)]
37 command: crate::commands::dbc::DbcCommands,
38 },
39
40 #[cfg(feature = "dbc")]
42 Dbd {
43 #[command(subcommand)]
44 command: crate::commands::dbd::DbdCommand,
45 },
46
47 #[cfg(feature = "blp")]
49 Blp {
50 #[command(subcommand)]
51 command: crate::commands::blp::BlpCommands,
52 },
53
54 #[cfg(feature = "m2")]
56 M2 {
57 #[command(subcommand)]
58 command: crate::commands::m2::M2Commands,
59 },
60
61 #[cfg(feature = "wmo")]
63 Wmo {
64 #[command(subcommand)]
65 command: crate::commands::wmo::WmoCommands,
66 },
67
68 #[cfg(feature = "adt")]
70 Adt {
71 #[command(subcommand)]
72 command: crate::commands::adt::AdtCommands,
73 },
74
75 #[cfg(feature = "wdt")]
77 Wdt {
78 #[command(subcommand)]
79 command: crate::commands::wdt::WdtCommands,
80 },
81
82 #[cfg(feature = "wdl")]
84 Wdl {
85 #[command(subcommand)]
86 command: crate::commands::wdl::WdlCommands,
87 },
88
89 Completions {
91 #[arg(value_enum)]
93 shell: clap_complete::Shell,
94 },
95}