mirror of
https://github.com/openstf/stf
synced 2025-10-03 17:59:28 +02:00
Allow provider to push.
This commit is contained in:
parent
5c923205db
commit
f60cf2008b
2 changed files with 22 additions and 12 deletions
26
lib/cli.js
26
lib/cli.js
|
@ -9,19 +9,17 @@ program
|
|||
program
|
||||
.command('provider [serial..]')
|
||||
.description('start provider')
|
||||
.option('-s, --connect-dev-sub <endpoint>', 'device sub endpoint',
|
||||
cliargs.list)
|
||||
.option('-p, --connect-dev-push <endpoint>', 'device push endpoint',
|
||||
cliargs.list)
|
||||
.option('-s, --connect-sub <endpoint>', 'sub endpoint', cliargs.list)
|
||||
.option('-p, --connect-push <endpoint>', 'push endpoint', cliargs.list)
|
||||
.action(function() {
|
||||
var serials = cliargs.allUnknownArgs(arguments)
|
||||
, options = cliargs.lastArg(arguments)
|
||||
|
||||
if (!options.connectDevSub) {
|
||||
this.missingArgument('--connect-dev-sub')
|
||||
if (!options.connectSub) {
|
||||
this.missingArgument('--connect-sub')
|
||||
}
|
||||
if (!options.connectDevPush) {
|
||||
this.missingArgument('--connect-dev-push')
|
||||
if (!options.connectPush) {
|
||||
this.missingArgument('--connect-push')
|
||||
}
|
||||
|
||||
require('./roles/provider')({
|
||||
|
@ -32,10 +30,14 @@ program
|
|||
var fork = require('child_process').fork
|
||||
return fork(__filename, [
|
||||
'device', device.id
|
||||
, '--connect-sub', options.connectDevSub.join(',')
|
||||
, '--connect-push', options.connectDevPush.join(',')
|
||||
, '--connect-sub', options.connectSub.join(',')
|
||||
, '--connect-push', options.connectPush.join(',')
|
||||
])
|
||||
}
|
||||
, endpoints: {
|
||||
sub: options.connectSub
|
||||
, push: options.connectPush
|
||||
}
|
||||
})
|
||||
})
|
||||
|
||||
|
@ -178,8 +180,8 @@ program
|
|||
// provider
|
||||
fork(__filename, [
|
||||
'provider'
|
||||
, '--connect-dev-sub', options.bindDevPub
|
||||
, '--connect-dev-push', options.bindDevPull
|
||||
, '--connect-sub', options.bindDevPub
|
||||
, '--connect-push', options.bindDevPull
|
||||
].concat(cliargs.allUnknownArgs(arguments)))
|
||||
})
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue