resolver_cli/utils/command_arguments.rs
1use clap::{Args, Parser, Subcommand};
2
3#[derive(Debug, Parser)]
4#[clap(author, version, about)]
5pub struct ClapperArgs {
6 #[clap(subcommand)]
7 pub entity_type: EntityType,
8}
9
10// ---------------
11// Valid Commands: get | scaffold
12// ---------------
13#[derive(Debug, Subcommand)]
14pub enum EntityType {
15 /// Clones projects boilerplate for diamond standard (JavaScript, TypeScript and Foundry) and NestJs
16 Get(GetCommand),
17 /// Scaffolds projects for any development tool
18 Scaffold(ScaffoldCommand),
19 /// Installs dependencies and software development tools
20 Install(InstallCommand),
21}
22
23// ----------------
24// GetCommand Args
25// ----------------
26#[derive(Debug, Args)]
27pub struct GetCommand{
28 #[clap(subcommand)]
29 pub command: GetSubCommand,
30}
31
32
33#[derive(Debug, Subcommand)]
34pub enum GetSubCommand {
35 /// Clones a diamond standard JavaScript project
36 Dhjs(GetDir),
37 /// Clones a diamond standard TypeScript project
38 Dhts(GetDir),
39 /// Clones a diamond standard Foundry project
40 Dfd(GetDir),
41 /// Clones a NestJS project boilerplate
42 Nestjs(GetDir)
43}
44
45// --------------------
46// ScaffoldCommand Args
47// --------------------
48#[derive(Debug, Args)]
49pub struct ScaffoldCommand{
50 #[clap(subcommand)]
51 pub command: ScaffoldSubCommand,
52}
53
54#[derive(Debug, Subcommand)]
55pub enum ScaffoldSubCommand {
56 /// Scaffolds a create-react-app JavaScript project
57 Reactjs(GetDir),
58 /// Scaffolds a create-react-app TypeScript project
59 Reactts(GetDir),
60 /// Scaffolds a Hardhat project
61 Hardhat(GetDir),
62 /// Scaffolds a NestJS project
63 Nestjs(GetDir),
64 /// Scaffolds a Laravel project
65 Laravel(GetDir),
66 /// Scaffolds a Next project
67 Nextjs(GetDir),
68 /// Scaffolds a Foundry project
69 Foundry(GetDir),
70 /// Scaffold a Vue.js project
71 Vue(GetDir),
72 /// Scaffold (Vanilla TypeScript, Vue, React, Preact, Lit, Svelte) projects using Vite
73 Vite(GetDir),
74 /// Scaffold a Noir project
75 Noir(GetDir),
76 /// Scaffold a Starknet Foundry project
77 Snforge(GetDir),
78}
79
80// ----------------
81// InstallCommand Args
82// ----------------
83#[derive(Debug, Args)]
84pub struct InstallCommand{
85 #[clap(subcommand)]
86 pub command: InstallSubCommand,
87}
88
89#[derive(Debug, Subcommand)]
90pub enum InstallSubCommand {
91 /// Installs Homebrew
92 Brew,
93 /// Installs Chocolatey
94 Choco,
95 /// Installs Node.js
96 Node,
97 /// Installs Scarb
98 Scarb,
99 /// Installs Forge
100 Forge,
101 /// Installs Starkli
102 Starkli,
103 /// Installs Nargo
104 Noir,
105 // installs Starknet Foundry
106 Snfoundry(Version),
107}
108
109// --------------------------------------
110// GetDir: For passing the directory name
111// --------------------------------------
112#[derive(Debug, Args)]
113pub struct GetDir {
114 /// Specifies the name of the project directory to initialize
115 pub dir_name: String
116}
117
118#[derive(Debug, Args)]
119pub struct Version {
120 pub version_name: String
121}