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 #[arg(short, long)]
47 #[arg(default_value_t = false)]
48 ignored: bool
49 },
50 Add {
52 #[arg(required = true)]
53 repos: Vec<String>
54 },
55 Rm {
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 },
64 Ignore {
66 #[arg(required = true)]
67 repos: Vec<String>,
68 },
69 Notice {
71 #[arg(required = true, group = "repositories")]
72 repos: Vec<String>,
73 #[arg(short, long, group = "repositories")]
75 #[arg(default_value_t = false)]
76 all: bool
77 },
78 Check {
80 #[arg(required = true, group = "repositories")]
81 repos: Vec<String>,
82 #[arg(short, long, group = "repositories")]
84 #[arg(default_value_t = false)]
85 all: bool,
86 #[arg(short, long, group = "output")]
88 #[arg(default_value_t = false)]
89 status: bool,
90 #[arg(short, long, group = "output")]
92 #[arg(default_value_t = false)]
93 remotes: bool
94 }
95}