1use clap::{Args, Parser, Subcommand};
2
3#[derive(Debug, Parser)]
4#[clap(author, version, about, long_about = None)]
5pub struct TomeArgs {
6 #[clap(subcommand)]
7 pub commands: TomeCommands,
8}
9
10#[derive(Debug, Subcommand)]
11pub enum TomeCommands {
12 CommandHelp(HelpArgs),
16 CommandComplete(CompleteArgs),
17 CommandExecute(ExecuteArgs),
18 Init(InitArgs),
19 Run(RunArgs),
24}
25
26#[derive(Debug, Args)]
27pub struct CompleteArgs {
28 pub command_directory_path: String,
29 #[clap(short, long)]
31 pub shell: String,
32 #[clap(last = true)]
33 pub args: Vec<String>,
34}
35
36#[derive(Debug, Args)]
37pub struct ExecuteArgs {
38 pub command_directory_path: String,
39 #[clap(short, long)]
40 pub shell: String,
41 #[clap(last = true)]
42 pub args: Vec<String>,
43}
44
45#[derive(Debug, Args)]
46pub struct HelpArgs {
47 pub command_directory_path: String,
48 #[clap(last = true)]
49 pub args: Vec<String>,
50}
51
52#[derive(Debug, Args)]
53pub struct InitArgs {
54 pub command_name: String,
56 pub command_directory_path: String,
58 pub shell_type_or_path: String,
60}
61
62#[derive(Debug, Args)]
63pub struct RunArgs {
64 pub command_directory_path: String,
65 #[clap(last = true)]
66 pub args: Vec<String>,
67}