@@ -16,7 +16,7 @@ const LOCATION_HELP: &str =
16
16
- Solana Program Registry artifact, for example `spr:QuarryProtocol/quarry_mine`
17
17
" ;
18
18
19
- #[ derive( Clone , Debug , clap:: Subcommand ) ]
19
+ #[ derive( Clone , Debug , clap:: Subcommand , PartialEq , Eq ) ]
20
20
pub enum SubCommand {
21
21
/// Initializes a new Goki workspace.
22
22
Init ,
@@ -33,6 +33,16 @@ pub enum SubCommand {
33
33
/// Airdrop request amount in SOL.
34
34
#[ clap( default_value = "1" ) ]
35
35
amount : String ,
36
+
37
+ /// Number of times to request an airdrop.
38
+ #[ clap( short, long) ]
39
+ #[ clap( default_value = "1" ) ]
40
+ iterations : u32 ,
41
+
42
+ /// Interval between airdrop requests, in milliseconds.
43
+ #[ clap( short, long) ]
44
+ #[ clap( default_value = "5000" ) ]
45
+ interval : u64 ,
36
46
} ,
37
47
/// Transfers SOL from a wallet.
38
48
Transfer {
@@ -143,17 +153,30 @@ pub struct Opts {
143
153
144
154
impl Opts {
145
155
pub async fn run ( & self ) -> Result < ( ) > {
156
+ if self . command . clone ( ) == SubCommand :: Init {
157
+ return subcommands:: init:: process ( & self . workspace_path ) ;
158
+ }
159
+
146
160
let workspace = Workspace :: load ( & self . workspace_path ) ?;
147
161
println ! ( "Using workspace at {}" , workspace. path. display( ) ) ;
148
162
match self . command . clone ( ) {
149
- SubCommand :: Init => {
150
- subcommands:: init:: process ( & workspace) ?;
151
- }
163
+ SubCommand :: Init => { }
152
164
SubCommand :: Show => {
153
165
subcommands:: show:: process ( & workspace) ?;
154
166
}
155
- SubCommand :: Airdrop { cluster, amount } => {
156
- subcommands:: airdrop:: process ( & workspace, cluster, amount. as_str ( ) ) ?;
167
+ SubCommand :: Airdrop {
168
+ cluster,
169
+ amount,
170
+ iterations,
171
+ interval,
172
+ } => {
173
+ subcommands:: airdrop:: process (
174
+ & workspace,
175
+ cluster,
176
+ amount. as_str ( ) ,
177
+ iterations,
178
+ interval,
179
+ ) ?;
157
180
}
158
181
SubCommand :: Transfer {
159
182
cluster,
0 commit comments