Skip to content

Commit ac93199

Browse files
committed
feat!: remove auto appending -- to arg key
1 parent 8d83005 commit ac93199

File tree

3 files changed

+5
-5
lines changed

3 files changed

+5
-5
lines changed

README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -75,7 +75,7 @@ main();
7575

7676
async function main() {
7777
// run: cloudflared tunnel --hello-world
78-
const { url, connections, child, stop } = tunnel({ "hello-world": null });
78+
const { url, connections, child, stop } = tunnel({ "--hello-world": null });
7979

8080
// show the url
8181
console.log("LINK:", await url);

examples/tunnel.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ main();
55

66
async function main() {
77
// run: cloudflared tunnel --hello-world
8-
const { url, connections, child, stop } = tunnel({ "hello-world": null });
8+
const { url, connections, child, stop } = tunnel({ "--hello-world": null });
99

1010
// show the url
1111
console.log("LINK:", await url);

src/utils.ts

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -19,11 +19,11 @@ export function tunnel(options: Record<string, string | number | null> = {}): {
1919
const args: string[] = ["tunnel"];
2020
for (const [key, value] of Object.entries(options)) {
2121
if (typeof value === "string") {
22-
args.push(`--${key}`, value);
22+
args.push(`${key}`, value);
2323
} else if (typeof value === "number") {
24-
args.push(`--${key}`, value.toString());
24+
args.push(`${key}`, value.toString());
2525
} else if (value === null) {
26-
args.push(`--${key}`);
26+
args.push(`${key}`);
2727
}
2828
}
2929

0 commit comments

Comments
 (0)