1use clap::{Parser, Subcommand};
4
5#[derive(Parser)]
7#[command(version, about, long_about = None)]
8#[command(propagate_version = true)]
9pub struct Cli {
10 #[command(subcommand)]
11 command: Commands
12}
13
14impl Cli {
15 #![allow(clippy::must_use_candidate)]
16 pub fn get_command(&self) -> &Commands {
17 &self.command
18 }
19}
20
21#[derive(Subcommand)]
23pub enum Commands {
24 Scan {
27 #[arg(required = true, group = "directories")]
29 dirs: Vec<String>,
30 #[arg(short, long, group = "directories")]
32 #[arg(default_value_t = false)]
33 all: bool,
34 #[arg(long)]
36 #[arg(default_value_t = false)]
37 hidden: bool,
38 #[arg(short, long)]
40 #[arg(default_value_t = false)]
41 quiet: bool
42 },
43 List,
45 Add {
47 #[arg(required = true)]
48 repos: Vec<String>
49 },
50 Rm {
52 #[arg(required = true, group = "repositories")]
53 repos: Vec<String>,
54 #[arg(short, long, group = "repositories")]
56 #[arg(default_value_t = false)]
57 all: bool
58 },
59 Check {
61 #[arg(required = true, group = "repositories")]
62 repos: Vec<String>,
63 #[arg(short, long, group = "repositories")]
65 #[arg(default_value_t = false)]
66 all: bool,
67 #[arg(short, long, group = "output")]
69 #[arg(default_value_t = false)]
70 status: bool,
71 #[arg(short, long, group = "output")]
73 #[arg(default_value_t = false)]
74 remotes: bool
75 }
76}