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", alias = "i")]
15 Install(InstallArgs),
16
17 #[command(name = "update", alias = "u")]
19 Update(UpdateArgs),
20
21 #[command(name = "remove", alias = "rm")]
23 Remove(RemoveArgs),
24
25 #[command(name = "list", alias = "ls")]
27 List,
28}
29
30#[derive(Debug, Args)]
31pub struct InstallArgs {
32 pub appname: String,
33
34 #[arg(long)]
36 pub from: String,
37
38 #[arg(long)]
40 pub executable: Option<String>,
41
42 #[arg(long, default_value_t = false)]
44 pub github: bool,
45}
46
47#[derive(Debug, Args)]
48pub struct UpdateArgs {
49 pub appname: String,
50}
51
52#[derive(Debug, Args)]
53pub struct RemoveArgs {
54 pub appname: String,
55}