@@ -243,7 +243,7 @@ export async function createCLI() {
243243 }
244244 const { signer, chainId } = await initializeSigner ( ) ;
245245 const commands = new Commands ( signer , chainId ) ;
246- await commands . computeStart ( [ null , dsDids , aDid , envId , JSON . stringify ( initResp ) , jobDuration , token , JSON . stringify ( res ) , amount . toString ( ) ] ) ;
246+ await commands . computeStart ( [ null , dsDids , aDid , envId , JSON . stringify ( initResp ) , jobDuration . toString ( ) , token , JSON . stringify ( res ) , amount . toString ( ) ] ) ;
247247 } ) ;
248248
249249 // startFreeCompute command
@@ -300,23 +300,22 @@ export async function createCLI() {
300300 . description ( 'Stops a compute job' )
301301 . argument ( '<datasetDid>' , 'Dataset DID' )
302302 . argument ( '<jobId>' , 'Job ID' )
303- . argument ( '[ agreementId] ' , 'Agreement ID' )
303+ . argument ( '< agreementId> ' , 'Agreement ID' )
304304 . option ( '-d, --dataset <datasetDid>' , 'Dataset DID' )
305305 . option ( '-j, --job <jobId>' , 'Job ID' )
306- . option ( '-a, --agreement [ agreementId] ' , 'Agreement ID' )
306+ . option ( '-a, --agreement < agreementId> ' , 'Agreement ID' )
307307 . action ( async ( datasetDid , jobId , agreementId , options ) => {
308308 const dsDid = options . dataset || datasetDid ;
309309 const jId = options . job || jobId ;
310310 const agrId = options . agreement || agreementId ;
311- if ( ! dsDid || ! jId ) {
311+ if ( ! dsDid || ! jId || ! agrId ) {
312312 console . error ( chalk . red ( 'Dataset DID and Job ID are required' ) ) ;
313313 // process.exit(1);
314314 return
315315 }
316316 const { signer, chainId } = await initializeSigner ( ) ;
317317 const commands = new Commands ( signer , chainId ) ;
318- const args = [ null , dsDid , jId ] ;
319- if ( agrId ) args . push ( agrId ) ;
318+ const args = [ null , dsDid , jId , agrId ] ;
320319 await commands . computeStop ( args ) ;
321320 } ) ;
322321
@@ -326,23 +325,22 @@ export async function createCLI() {
326325 . description ( 'Displays the compute job status' )
327326 . argument ( '<datasetDid>' , 'Dataset DID' )
328327 . argument ( '<jobId>' , 'Job ID' )
329- . argument ( '[ agreementId] ' , 'Agreement ID' )
328+ . argument ( '< agreementId> ' , 'Agreement ID' )
330329 . option ( '-d, --dataset <datasetDid>' , 'Dataset DID' )
331330 . option ( '-j, --job <jobId>' , 'Job ID' )
332- . option ( '-a, --agreement [ agreementId] ' , 'Agreement ID' )
331+ . option ( '-a, --agreement < agreementId> ' , 'Agreement ID' )
333332 . action ( async ( datasetDid , jobId , agreementId , options ) => {
334333 const dsDid = options . dataset || datasetDid ;
335334 const jId = options . job || jobId ;
336335 const agrId = options . agreement || agreementId ;
337- if ( ! dsDid || ! jId ) {
336+ if ( ! dsDid || ! jId || ! agrId ) {
338337 console . error ( chalk . red ( 'Dataset DID and Job ID are required' ) ) ;
339338 // process.exit(1);
340339 return
341340 }
342341 const { signer, chainId } = await initializeSigner ( ) ;
343342 const commands = new Commands ( signer , chainId ) ;
344- const args = [ null , dsDid , jId ] ;
345- if ( agrId ) args . push ( agrId ) ;
343+ const args = [ null , dsDid , jId , agrId ] ;
346344 await commands . getJobStatus ( args ) ;
347345 } ) ;
348346
0 commit comments