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 },
39 List,
41 Add {
43 #[arg(required = true)]
44 repos: Vec<String>
45 },
46 Rm {
48 #[arg(required = true, group = "repositories")]
49 repos: Vec<String>,
50 #[arg(short, long, group = "repositories")]
52 #[arg(default_value_t = false)]
53 all: bool
54 },
55 Check {
57 #[arg(required = true, group = "repositories")]
58 repos: Vec<String>,
59 #[arg(short, long, group = "repositories")]
61 #[arg(default_value_t = false)]
62 all: bool,
63 #[arg(short, long, group = "output")]
65 #[arg(default_value_t = false)]
66 status: bool,
67 #[arg(short, long, group = "output")]
69 #[arg(default_value_t = false)]
70 remotes: bool
71 }
72}