未验证 提交 e44ac0a3 编写于 作者: A Asher

Use last positional argument as working directory

Instead of the first.
上级 319cd3f7
......@@ -178,7 +178,7 @@ export class VscodeHttpProvider extends HttpProvider {
{ url: route.query.workspace, workspace: true },
{ url: route.query.folder, workspace: false },
lastVisited,
this.args._ && this.args._.length > 0 ? { url: this.args._[0] } : undefined,
this.args._ && this.args._.length > 0 ? { url: this.args._[this.args._.length - 1] } : undefined,
],
remoteAuthority,
)
......
......@@ -151,4 +151,13 @@ describe("cli", () => {
})
assert.throws(() => parse(["--cert", "--socket-path-value"]), /Unknown option --socket-path-value/)
})
it("should allow positional arguments before options", () => {
assert.deepEqual(parse(["foo", "test", "--auth", "none"]), {
_: ["foo", "test"],
"extensions-dir": path.join(xdgLocalDir, "extensions"),
"user-data-dir": xdgLocalDir,
auth: "none",
})
})
})
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册