Skip to content

Commit

Permalink
fix(cli): remove default: false for opt-in flag
Browse files Browse the repository at this point in the history
this allows to make a difference between providing a true/false value or not providing it usable for external frameworks
  • Loading branch information
pi0 committed Sep 6, 2023
1 parent bb2b9f1 commit 180c685
Showing 1 changed file with 1 addition and 4 deletions.
5 changes: 1 addition & 4 deletions src/cli.ts
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,6 @@ export const main = defineCommand({
type: "boolean",
description: "Watch for changes",
alias: "w",
default: false,
},
...getArgs(),
},
Expand Down Expand Up @@ -81,17 +80,14 @@ export function getArgs() {
clipboard: {
type: "boolean",
description: "Copy the URL to the clipboard",
default: false,
},
open: {
type: "boolean",
description: "Open the URL in the browser",
default: false,
},
https: {
type: "boolean",
description: "Enable HTTPS",
default: false,
},
"https.cert": {
type: "string",
Expand Down Expand Up @@ -147,6 +143,7 @@ type ParsedListhenArgs = ParsedArgs<ReturnType<typeof getArgs>>;

/** Convert unjs/citty compatible args to listhen options */
export function parseArgs(args: ParsedListhenArgs): Partial<ListenOptions> {
console.log("args", args);
return {
port: args.port,
// prettier-ignore
Expand Down

0 comments on commit 180c685

Please sign in to comment.