thot_cli/commands/project/
mod.rs

1use crate::result::Result;
2use crate::types::ResourcePathType;
3use clap::{Args, Subcommand};
4use std::path::PathBuf;
5mod commands;
6
7// **************************
8// *** top level commands ***
9// **************************
10pub mod init;
11pub mod r#move;
12pub mod new;
13
14// ********************
15// *** sub commands ***
16// ********************
17
18pub fn main(args: ProjectArgs, verbose: bool) -> Result {
19    match args.command {
20        Command::AddScript(add_args) => commands::add_script(add_args, verbose),
21    }
22}
23
24#[derive(Debug, Args)]
25pub struct ProjectArgs {
26    #[clap(subcommand)]
27    command: Command,
28}
29
30#[derive(Debug, Subcommand)]
31enum Command {
32    AddScript(AddScriptArgs),
33}
34
35#[derive(Debug, Args)]
36pub struct AddScriptArgs {
37    #[clap(parse(from_os_str))]
38    path: PathBuf,
39
40    #[clap(short, long, parse(from_os_str))]
41    project: Option<PathBuf>,
42
43    // @todo: Allow path type to be specified
44    // #[clap(long, value_enum)]
45    // path_type: Option<ResourcePathType>,
46}