Skip to content

Commit 81862d4

Browse files
committed
Add back (most of) our old arguments
Also remove VS Code ones that don't work.
1 parent 2fdf09e commit 81862d4

2 files changed

Lines changed: 57 additions & 3 deletions

File tree

cli.ts

Lines changed: 56 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -9,12 +9,60 @@ import { MainServer, WebviewServer } from "vs/server/server";
99
import "vs/server/tar";
1010

1111
interface Args extends ParsedArgs {
12+
"allow-http"?: boolean;
13+
cert?: string;
14+
"cert-key"?: string;
15+
"extra-builtin-extensions-dir"?: string;
16+
"extra-extensions-dir"?: string;
17+
host?: string;
18+
"no-auth"?: boolean;
19+
open?: string;
1220
port?: string;
21+
socket?: string;
1322
"webview-port"?: string;
23+
"webview-socket"?: string;
1424
}
1525

26+
// The last item is _ which is like -- so our options need to come before it.
27+
const last = options.pop()!;
28+
29+
// Remove options that won't work or don't make sense.
30+
let i = options.length;
31+
while (i--) {
32+
switch (options[i].id) {
33+
case "add":
34+
case "diff":
35+
case "file-uri":
36+
case "folder-uri":
37+
case "goto":
38+
case "new-window":
39+
case "reuse-window":
40+
case "wait":
41+
case "disable-gpu":
42+
// TODO: pretty sure these don't work but not 100%.
43+
case "max-memory":
44+
case "prof-startup":
45+
case "inspect-extensions":
46+
case "inspect-brk-extensions":
47+
options.splice(i, 1);
48+
break;
49+
}
50+
}
51+
52+
options.push({ id: "allow-http", type: "boolean", cat: "o", description: "Allow http connections." });
53+
options.push({ id: "cert", type: "string", cat: "o", description: "Path to certificate." });
54+
options.push({ id: "cert-key", type: "string", cat: "o", description: "Path to certificate key." });
55+
options.push({ id: "extra-builtin-extensions-dir", type: "string", cat: "o", description: "Path to extra builtin extension directory." });
56+
options.push({ id: "extra-extensions-dir", type: "string", cat: "o", description: "Path to extra user extension directory." });
57+
options.push({ id: "host", type: "string", cat: "o", description: "Host for the main and webview servers." });
58+
options.push({ id: "no-auth", type: "string", cat: "o", description: "Disable password authentication." });
59+
options.push({ id: "open", type: "boolean", cat: "o", description: "Open in the browser on startup." });
1660
options.push({ id: "port", type: "string", cat: "o", description: "Port for the main server." });
61+
options.push({ id: "socket", type: "string", cat: "o", description: "Listen on a socket instead of host:port." });
1762
options.push({ id: "webview-port", type: "string", cat: "o", description: "Port for the webview server." });
63+
options.push({ id: "webview-socket", type: "string", cat: "o", description: "Listen on a socket instead of host:port." });
64+
65+
options.push(last);
1866

1967
interface IMainCli {
2068
main: (argv: ParsedArgs) => Promise<void>;
@@ -32,13 +80,19 @@ const main = async (): Promise<void> => {
3280
};
3381
}
3482

83+
const version = `${(pkg as any).codeServerVersion || "development"}-vsc${pkg.version}`;
3584
if (args.help) {
3685
const executable = `${product.applicationName}${os.platform() === "win32" ? ".exe" : ""}`;
37-
return console.log(buildHelpMessage(product.nameLong, executable, pkg.version));
86+
return console.log(buildHelpMessage(
87+
product.nameLong, executable,
88+
version,
89+
undefined,
90+
false,
91+
));
3892
}
3993

4094
if (args.version) {
41-
return console.log(buildVersionMessage(pkg.version, product.commit));
95+
return console.log(buildVersionMessage(version, product.commit));
4296
}
4397

4498
const shouldSpawnCliProcess = (): boolean => {

scripts/tasks.bash

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -218,7 +218,7 @@ function binary-task() {
218218
node "${rootPath}/scripts/nbin.js" "${target}" "${arch}" "${codeServerBuildPath}"
219219
rm node_modules/@coder/nbin
220220
mv "${codeServerBuildPath}/code-server" "${buildPath}/${binaryName}"
221-
log "Binary at ${buildPath}/${binaryName}"
221+
log "Binary: ${buildPath}/${binaryName}"
222222
}
223223

224224
function main() {

0 commit comments

Comments
 (0)