1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
use clap::{Args, Parser, Subcommand};
use serde::{Deserialize, Serialize};
#[derive(Serialize, Deserialize, Debug)]
pub struct GcpConfig {
pub project_id: String,
pub service_name: String,
pub region: String,
}
#[derive(Parser)]
#[clap(name = "zapp")]
#[clap(about = "Rust Serverless Framework")]
#[clap(author = "EpicsDAO", version, long_about = None)]
pub struct Cli {
#[clap(subcommand)]
pub command: Commands,
}
#[derive(Subcommand)]
pub enum Commands {
Iam(Iam),
Run(Run),
Gh(Gh),
Init(Init),
Compute(Compute),
Docker(Docker),
Sql(Sql),
G(G),
Db(Db),
New {
app_name: String
}
}
#[derive(Debug, Args)]
#[clap(args_conflicts_with_subcommands = true)]
pub struct Iam {
#[clap(subcommand)]
pub command: Option<IamCommands>,
}
#[derive(Debug, Args)]
#[clap(args_conflicts_with_subcommands = true)]
pub struct Compute {
#[clap(subcommand)]
pub command: Option<ComputeCommands>,
}
#[derive(Debug, Args)]
#[clap(args_conflicts_with_subcommands = true)]
pub struct Init {
#[clap(subcommand)]
pub command: Option<InitCommands>,
}
#[derive(Debug, Args)]
#[clap(args_conflicts_with_subcommands = true)]
pub struct Gh {
#[clap(subcommand)]
pub command: Option<GhCommands>,
}
#[derive(Debug, Args)]
#[clap(args_conflicts_with_subcommands = true)]
pub struct Run {
#[clap(subcommand)]
pub command: Option<RunCommands>,
}
#[derive(Debug, Args)]
#[clap(args_conflicts_with_subcommands = true)]
pub struct Docker {
#[clap(subcommand)]
pub command: Option<DockerCommands>,
}
#[derive(Debug, Args)]
#[clap(args_conflicts_with_subcommands = true)]
pub struct Sql {
#[clap(subcommand)]
pub command: Option<SqlCommands>,
}
#[derive(Debug, Args)]
#[clap(args_conflicts_with_subcommands = true)]
pub struct G {
#[clap(subcommand)]
pub command: Option<GCommands>,
}
#[derive(Debug, Args)]
#[clap(args_conflicts_with_subcommands = true)]
pub struct Db {
#[clap(subcommand)]
pub command: Option<DbCommands>,
}
#[derive(Debug, Subcommand)]
pub enum IamCommands {
Setup,
Help,
}
#[derive(Debug, Subcommand)]
pub enum ComputeCommands {
CreateNat,
Setup,
Help,
}
#[derive(Debug, Subcommand)]
pub enum InitCommands {
Config,
GhActions,
Help,
}
#[derive(Debug, Subcommand)]
pub enum GhCommands {
AddEnv,
Help,
}
#[derive(Debug, Subcommand)]
pub enum RunCommands {
Build,
Deploy,
Help,
}
#[derive(Debug, Subcommand)]
pub enum DockerCommands {
Psql,
Build,
Push,
Help,
}
#[derive(Debug, Subcommand)]
pub enum SqlCommands {
Create,
Patch {
action: String
},
Restart,
SetPrivateIp,
Help
}
#[derive(Debug, Subcommand)]
pub enum GCommands {
Model {
model: String
},
Help
}
#[derive(Debug, Subcommand)]
pub enum DbCommands {
Migrate,
Help
}