@@ -16,7 +16,7 @@ const LOCATION_HELP: &str =
1616- Solana Program Registry artifact, for example `spr:QuarryProtocol/quarry_mine`
1717" ;
1818
19- #[ derive( Clone , Debug , clap:: Subcommand ) ]
19+ #[ derive( Clone , Debug , clap:: Subcommand , PartialEq , Eq ) ]
2020pub enum SubCommand {
2121 /// Initializes a new Goki workspace.
2222 Init ,
@@ -33,6 +33,16 @@ pub enum SubCommand {
3333 /// Airdrop request amount in SOL.
3434 #[ clap( default_value = "1" ) ]
3535 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 ,
3646 } ,
3747 /// Transfers SOL from a wallet.
3848 Transfer {
@@ -143,17 +153,30 @@ pub struct Opts {
143153
144154impl Opts {
145155 pub async fn run ( & self ) -> Result < ( ) > {
156+ if self . command . clone ( ) == SubCommand :: Init {
157+ return subcommands:: init:: process ( & self . workspace_path ) ;
158+ }
159+
146160 let workspace = Workspace :: load ( & self . workspace_path ) ?;
147161 println ! ( "Using workspace at {}" , workspace. path. display( ) ) ;
148162 match self . command . clone ( ) {
149- SubCommand :: Init => {
150- subcommands:: init:: process ( & workspace) ?;
151- }
163+ SubCommand :: Init => { }
152164 SubCommand :: Show => {
153165 subcommands:: show:: process ( & workspace) ?;
154166 }
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+ ) ?;
157180 }
158181 SubCommand :: Transfer {
159182 cluster,
0 commit comments