1use clap::{Args, Subcommand};
2
3#[derive(Debug, Subcommand)]
4pub enum Commands {
5 Cd { project_name: String },
7 Hook(Hook),
9 #[clap(visible_alias = "r")]
11 Run { script: String },
12 Project(Project),
14 Script(Script),
16 Shell(Shell),
18}
19
20#[derive(Debug, Args)]
21#[command(args_conflicts_with_subcommands = true)]
22pub struct Hook {
23 #[command(subcommand)]
24 pub command: Option<HookCommands>,
25}
26
27#[derive(Debug, Subcommand)]
28pub enum HookCommands {
29 Set {
31 #[clap(value_delimiter = ',')]
32 hook: Vec<String>,
33 },
34}
35
36#[derive(Debug, Args)]
37#[command(args_conflicts_with_subcommands = true)]
38pub struct Shell {
39 #[command(subcommand)]
40 pub command: Option<ShellCommands>,
41}
42
43#[derive(Debug, Subcommand)]
44pub enum ShellCommands {
45 #[clap(visible_alias = "sh")]
47 Bash,
48 Zsh,
49}
50
51#[derive(Debug, Args)]
52#[command(args_conflicts_with_subcommands = true)]
53pub struct Script {
54 #[command(subcommand)]
55 pub command: Option<ScriptCommands>,
56}
57
58#[derive(Debug, Subcommand)]
59pub enum ScriptCommands {
60 Add {
62 script_name: String,
64 script_command: String,
66 },
67 #[clap(visible_alias = "rm")]
69 Remove { script: String },
70 #[clap(visible_alias = "ls")]
72 List,
73}
74
75#[derive(Debug, Args)]
76#[command(args_conflicts_with_subcommands = true)]
77pub struct Project {
78 #[command(subcommand)]
79 pub command: ProjectCommands,
80}
81
82#[derive(Debug, Subcommand)]
83pub enum ProjectCommands {
84 Add {
86 project_name: String,
88 project_path: String,
90 },
91 #[clap(visible_alias = "go")]
93 Cd { project_name: String },
94 #[clap(visible_alias = "ls")]
96 List,
97 #[clap(visible_alias = "rm")]
99 Remove { project_name: String },
100 Init {
102 project_name: Option<String>,
104 },
105}