You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: src/server-main.js
+12-8Lines changed: 12 additions & 8 deletions
Original file line number
Diff line number
Diff line change
@@ -147,9 +147,9 @@ async function start() {
147
147
}
148
148
149
149
/**
150
-
* If `--pick - port` and `--port` is specified, connect to that port.
150
+
* If `--pick-port` and `--port` is specified, connect to that port.
151
151
*
152
-
* If not and a port range is specified through `--pick - port`
152
+
* If not and a port range is specified through `--pick-port`
153
153
* then find a free port in that range. Throw error if no
154
154
* free port available in range.
155
155
*
@@ -176,14 +176,15 @@ async function parsePort(host, strPort, strPickPort) {
176
176
if(port!==undefined){
177
177
returnport;
178
178
}
179
-
console.warn(`--port: Could not find free port in range: ${range.start} - ${range.end}.`);
179
+
console.warn(`--port: Could not find free port in range: ${range.start} - ${range.end} (inclusive).`);
180
180
process.exit(1);
181
181
182
182
}else{
183
-
console.warn(`--port "${strPort}" is not a valid number or range.`);
183
+
console.warn(`--port "${strPort}" is not a valid number or range. Ranges must be in the form 'from-to' with 'from' an integer larger than 0 and not larger than 'end'.`);
184
184
process.exit(1);
185
185
}
186
186
}
187
+
// pick-port is deprected and will be removed soon
187
188
if(strPickPort){
188
189
constrange=parseRange(strPickPort);
189
190
if(range){
@@ -194,11 +195,11 @@ async function parsePort(host, strPort, strPickPort) {
194
195
if(port!==undefined){
195
196
returnport;
196
197
}
197
-
console.log(`--pick - port: Could not find free port in range: ${range.start} - ${range.end}.`);
198
+
console.log(`--pick-port: Could not find free port in range: ${range.start} - ${range.end}.`);
198
199
process.exit(1);
199
200
}
200
201
}else{
201
-
console.log(`--pick - port "${strPickPort}" is not properly formatted.`);
202
+
console.log(`--pick-port "${strPickPort}" is not a valid range. Ranges must be in the form 'from-to' with 'from' an integer larger than 0 and not larger than 'end'.`);
202
203
process.exit(1);
203
204
}
204
205
}
@@ -212,7 +213,10 @@ async function parsePort(host, strPort, strPickPort) {
'host': {type: 'string',cat: 'o',args: 'ip-address',description: nls.localize('host',"The host name or IP address the server should listen to. If not set, defaults to 'localhost'.")},
18
-
'port': {type: 'string',cat: 'o',args: 'port | port range',description: nls.localize('port',"The port the server should listen to. If 0 is passed a random free port is picked. If a range in the format num-num is passed, a free port from the range is selected.")},
19
-
'pick-port': {type: 'string',deprecationMessage: "Use the range notation in 'port' instead."},
18
+
'port': {type: 'string',cat: 'o',args: 'port | port range',description: nls.localize('port',"The port the server should listen to. If 0 is passed a random free port is picked. If a range in the format num-num is passed, a free port from the range (end inclusive) is selected.")},
19
+
'pick-port': {type: 'string',deprecationMessage: 'Use the range notation in \'port\' instead.'},
20
20
'socket-path': {type: 'string',cat: 'o',args: 'path',description: nls.localize('socket-path',"The path to a socket file for the server to listen to.")},
21
21
'connection-token': {type: 'string',cat: 'o',args: 'token',deprecates: ['connectionToken'],description: nls.localize('connection-token',"A secret that must be included with all requests.")},
22
22
'connection-token-file': {type: 'string',cat: 'o',args: 'path',deprecates: ['connection-secret','connectionTokenFile'],description: nls.localize('connection-token-file',"Path to a file that contains the connection token.")},
0 commit comments