Skip to content

Commit e44ac0a

Browse files
committed
Use last positional argument as working directory
Instead of the first.
1 parent 319cd3f commit e44ac0a

File tree

2 files changed

+10
-1
lines changed

2 files changed

+10
-1
lines changed

src/node/app/vscode.ts

+1-1
Original file line numberDiff line numberDiff line change
@@ -178,7 +178,7 @@ export class VscodeHttpProvider extends HttpProvider {
178178
{ url: route.query.workspace, workspace: true },
179179
{ url: route.query.folder, workspace: false },
180180
lastVisited,
181-
this.args._ && this.args._.length > 0 ? { url: this.args._[0] } : undefined,
181+
this.args._ && this.args._.length > 0 ? { url: this.args._[this.args._.length - 1] } : undefined,
182182
],
183183
remoteAuthority,
184184
)

test/cli.test.ts

+9
Original file line numberDiff line numberDiff line change
@@ -151,4 +151,13 @@ describe("cli", () => {
151151
})
152152
assert.throws(() => parse(["--cert", "--socket-path-value"]), /Unknown option --socket-path-value/)
153153
})
154+
155+
it("should allow positional arguments before options", () => {
156+
assert.deepEqual(parse(["foo", "test", "--auth", "none"]), {
157+
_: ["foo", "test"],
158+
"extensions-dir": path.join(xdgLocalDir, "extensions"),
159+
"user-data-dir": xdgLocalDir,
160+
auth: "none",
161+
})
162+
})
154163
})

0 commit comments

Comments
 (0)