1
0
Fork 0
mirror of https://github.com/openstf/stf synced 2025-10-05 10:39:25 +02:00

Setting parse-numbers: false caused number options to become strings as well. Since we seem to have little control over positional arguments, let's make it an option instead.

This commit is contained in:
Simo Kinnunen 2017-01-27 17:26:18 +09:00
parent 06efac4e6e
commit 586dd6a4aa
3 changed files with 11 additions and 2 deletions

View file

@ -1,4 +1,4 @@
module.exports.command = 'device <serial>' module.exports.command = 'device'
module.exports.builder = function(yargs) { module.exports.builder = function(yargs) {
return yargs return yargs
@ -101,6 +101,11 @@ module.exports.builder = function(yargs) {
, type: 'string' , type: 'string'
, default: 'ws://${publicIp}:${publicPort}' , default: 'ws://${publicIp}:${publicPort}'
}) })
.option('serial', {
describe: 'The USB serial number of the device.'
, type: 'string'
, demand: true
})
.option('storage-url', { .option('storage-url', {
alias: 'r' alias: 'r'
, describe: 'The URL to the storage unit.' , describe: 'The URL to the storage unit.'

View file

@ -159,7 +159,8 @@ module.exports.handler = function(argv) {
var fork = require('child_process').fork var fork = require('child_process').fork
var args = [ var args = [
'device', device.id 'device'
, '--serial', device.id
, '--provider', argv.name , '--provider', argv.name
, '--screen-port', ports.shift() , '--screen-port', ports.shift()
, '--connect-port', ports.shift() , '--connect-port', ports.shift()

View file

@ -25,6 +25,9 @@
"bin": { "bin": {
"stf": "./bin/stf" "stf": "./bin/stf"
}, },
"yargs": {
"duplicate-arguments-array": false
},
"scripts": { "scripts": {
"test": "gulp test", "test": "gulp test",
"prepublish": "bower install && not-in-install && gulp build || in-install" "prepublish": "bower install && not-in-install && gulp build || in-install"