Move start path logic out of patch and fix it

This commit is contained in:
Asher
2020-02-06 12:29:19 -06:00
parent efaeb3b110
commit 8a0f1d846e
5 changed files with 107 additions and 89 deletions

27
src/node/cli.ts Normal file
View File

@ -0,0 +1,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] : [],
}
}