You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
If the optional argument was passed, it will be present
at key name in the object returned from parse or run.
Otherwise, the object will not contain the key name.
However, it seems that the value does appear, with null as its value:
// reproduce_null.tsimport*ascfrom"https://deno.land/x/clay@v0.2.5/mod.ts"console.log(newc.Command("tell me your name").optional(c.string,"name",{flags: ["n","name"],description: "the name"},).run(),)
Output:
$ deno run -A ./reproduce_null.ts -htell me your nameUSAGE: [OPTIONS]OPTIONS: -n, --name <STRING> the name
$ deno run -A ./reproduce_null.ts -n Bob{ name: "Bob" }
$ deno run -A ./reproduce_null.ts{ name: null }
The text was updated successfully, but these errors were encountered:
From the Clay source code:
However, it seems that the value does appear, with
null
as its value:Output:
The text was updated successfully, but these errors were encountered: