Skip to content
This repository has been archived by the owner on Jul 16, 2024. It is now read-only.

Commit

Permalink
update prompt example
Browse files Browse the repository at this point in the history
  • Loading branch information
tim-smart committed Nov 28, 2023
1 parent a6fe132 commit d10882d
Showing 1 changed file with 4 additions and 6 deletions.
10 changes: 4 additions & 6 deletions examples/prompt.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import * as CliApp from "@effect/cli/CliApp"
import * as Command from "@effect/cli/CommandDescriptor"
import * as Command from "@effect/cli/Command"
import * as Prompt from "@effect/cli/Prompt"
import * as NodeContext from "@effect/platform-node/NodeContext"
import * as Runtime from "@effect/platform-node/Runtime"
Expand Down Expand Up @@ -57,14 +57,12 @@ const prompt = Prompt.all([
togglePrompt
])

const cli = CliApp.make({
const cli = Command.run(Command.prompt("favorites", prompt, Effect.log), {
name: "Prompt Examples",
version: "0.0.1",
command: Command.prompt("favorites", prompt)
version: "0.0.1"
})

Effect.sync(() => process.argv.slice(2)).pipe(
Effect.flatMap((args) => CliApp.run(cli, args, (input) => Effect.log(input))),
Effect.suspend(() => cli(process.argv.slice(2))).pipe(
Effect.provide(NodeContext.layer),
Runtime.runMain
)

0 comments on commit d10882d

Please sign in to comment.