1
0
Fork 0
mirror of https://github.com/openstf/stf synced 2025-10-04 18:29:17 +02:00

Fix stf local not accepting multiple serials. Fixes #91.

This commit is contained in:
Simo Kinnunen 2015-10-14 01:56:30 +09:00
parent b248e96dc2
commit 0942ecea7a
2 changed files with 5 additions and 18 deletions

View file

@ -15,7 +15,7 @@ program
.version(pkg.version)
program
.command('provider [serial..]')
.command('provider [serial...]')
.description('start provider')
.option('-s, --connect-sub <endpoint>'
, 'sub endpoint'
@ -76,10 +76,7 @@ program
, 'whether to mute master volume when devices are being used')
.option('--lock-rotation'
, 'whether to lock rotation when devices are being used')
.action(function() {
var serials = cliutil.allUnknownArgs(arguments)
, options = cliutil.lastArg(arguments)
.action(function(serials, options) {
if (!options.connectSub) {
this.missingArgument('--connect-sub')
}
@ -862,7 +859,7 @@ program
})
program
.command('local [serial..]')
.command('local [serial...]')
.description('start everything locally')
.option('--bind-app-pub <endpoint>'
, 'app pub endpoint'
@ -972,10 +969,8 @@ program
, 'whether to mute master volume when devices are being used')
.option('--lock-rotation'
, 'whether to lock rotation when devices are being used')
.action(function() {
.action(function(serials, options) {
var log = logger.createLogger('cli:local')
, args = arguments
, options = cliutil.lastArg(args)
, procutil = require('./util/procutil')
// Each forked process waits for signals to stop, and so we run over the
@ -1040,7 +1035,7 @@ program
.concat(options.allowRemote ? ['--allow-remote'] : [])
.concat(options.muteMaster ? ['--mute-master'] : [])
.concat(options.lockRotation ? ['--lock-rotation'] : [])
.concat(cliutil.allUnknownArgs(args)))
.concat(serials))
// auth
, procutil.fork(__filename, [

View file

@ -7,14 +7,6 @@ module.exports.size = function(val) {
return match ? [+match[1], +match[2]] : undefined
}
module.exports.allUnknownArgs = function(args) {
return [].slice.call(args, 0, -1).filter(Boolean)
}
module.exports.lastArg = function(args) {
return args[args.length - 1]
}
module.exports.range = function(from, to) {
var items = []
, i