1use clap::{Args, Parser, Subcommand};
2
3#[derive(Debug, Parser)]
5#[command(version, about, long_about = None)]
6pub struct Cli {
7 #[command(subcommand)]
8 pub command: Command,
9}
10
11#[derive(Debug, Subcommand)]
12pub enum Command {
13 #[command(name = "install")]
15 Install(InstallArgs),
16
17 #[command(name = "update")]
19 Update,
20
21 #[command(name = "upgrade")]
23 Upgrade(UpgradeArgs),
24
25 #[command(name = "remove")]
27 Remove(RemoveArgs),
28
29 #[command(name = "search")]
31 Search(SearchArgs),
32
33 #[command(name = "appimage", aliases = ["a", "ai"])]
35 AppImage {
36 #[command(subcommand)]
37 action: zap_rs::Command,
38 },
39
40 #[command(name = "repo")]
42 Repo,
43}
44
45#[derive(Debug, Args)]
46pub struct InstallArgs {
47 pub packages: Vec<String>,
49
50 #[arg(long, short = 'y', default_value_t = false)]
52 pub yes: bool,
53}
54
55#[derive(Debug, Args)]
56pub struct UpgradeArgs {
57 pub packages: Vec<String>,
59
60 #[arg(long, short = 'y', default_value_t = false)]
62 pub yes: bool,
63}
64
65#[derive(Debug, Args)]
66pub struct RemoveArgs {
67 pub packages: Vec<String>,
69
70 #[arg(long, short = 'y', default_value_t = false)]
72 pub yes: bool,
73}
74
75#[derive(Debug, Args)]
76pub struct SearchArgs {
77 pub package: String,
79}