forked from coder/code-server
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathcli.ts
More file actions
27 lines (25 loc) · 647 Bytes
/
Copy pathcli.ts
File metadata and controls
27 lines (25 loc) · 647 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
import { AuthType } from "./http"
import { Args as VsArgs } from "../../lib/vscode/src/vs/server/ipc"
export interface Args extends VsArgs {
auth?: AuthType
"base-path"?: string
cert?: string
"cert-key"?: string
format?: string
host?: string
json?: boolean
open?: boolean
port?: string
socket?: string
version?: boolean
_: string[]
}
// TODO: Implement proper CLI parser.
export const parse = (): Args => {
const last = process.argv[process.argv.length - 1]
return {
version: process.argv.includes("--version"),
json: process.argv.includes("--json"),
_: last && !last.startsWith("-") ? [last] : [],
}
}