mirror of
https://github.com/DeviceFarmer/stf.git
synced 2026-04-19 16:43:26 +02:00
Allow screen URL pattern to be changed.
This commit is contained in:
19
lib/cli.js
19
lib/cli.js
@@ -59,6 +59,12 @@ program
|
||||
, 'ADB port (defaults to 5037)'
|
||||
, Number
|
||||
, 5037)
|
||||
.option('--screen-ws-url-pattern <pattern>'
|
||||
, 'screen WebSocket URL pattern'
|
||||
, String
|
||||
, 'ws://${publicIp}:${publicPort}')
|
||||
.option('--disable-screen-public-proxy'
|
||||
, 'no public proxy for screen')
|
||||
.action(function() {
|
||||
var serials = cliutil.allUnknownArgs(arguments)
|
||||
, options = cliutil.lastArg(arguments)
|
||||
@@ -94,7 +100,10 @@ program
|
||||
, '--storage-url', options.storageUrl
|
||||
, '--adb-host', options.adbHost
|
||||
, '--adb-port', options.adbPort
|
||||
])
|
||||
, '--screen-ws-url-pattern', options.screenWsUrlPattern
|
||||
]
|
||||
.concat(options.disableScreenPublicProxy
|
||||
? ['--disable-screen-public-proxy'] : []))
|
||||
}
|
||||
, endpoints: {
|
||||
sub: options.connectSub
|
||||
@@ -139,6 +148,12 @@ program
|
||||
, 'ADB port (defaults to 5037)'
|
||||
, Number
|
||||
, 5037)
|
||||
.option('--screen-ws-url-pattern <pattern>'
|
||||
, 'screen WebSocket URL pattern'
|
||||
, String
|
||||
, 'ws://${publicIp}:${publicPort}')
|
||||
.option('--disable-screen-public-proxy'
|
||||
, 'no public proxy for screen')
|
||||
.action(function(serial, options) {
|
||||
if (!options.connectSub) {
|
||||
this.missingArgument('--connect-sub')
|
||||
@@ -169,6 +184,8 @@ program
|
||||
, storageUrl: options.storageUrl
|
||||
, adbHost: options.adbHost
|
||||
, adbPort: options.adbPort
|
||||
, disableScreenPublicProxy: !!options.disableScreenPublicProxy
|
||||
, screenWsUrlPattern: options.screenWsUrlPattern
|
||||
})
|
||||
})
|
||||
|
||||
|
||||
Reference in New Issue
Block a user