Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

github.com/stelmanjones/termtools/prompt

Package Overview
Dependencies
Alerts
File Explorer
Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

github.com/stelmanjones/termtools/prompt

  • v0.0.0-20241019130637-5aad845f47e0
  • Source
  • Go
  • Socket score

Version published
Created
Source

Prompts

Go Reference Go Report Card License

The Prompt module is a part of the termtools package and provides a set of interactive prompts for command-line interfaces. It includes selection prompts, question prompts, and confirmation prompts.

Example Example

Install

import "github.com/stelmanjones/termtools/prompt"

Features

  • Selection Prompt: Allows users to select an option from a list of choices. Choices can be added using the AddChoice methods.
p := prompt.NewSelectionPrompt[int]()
p.AddChoice(1)
p.AddChoices(2,3,4,5,6,7)
p.RemoveWhenDone()
result, err := p.Run()
  • Question Prompt: Asks users a question and waits for their input.
q := prompt.NewQuestionPrompt("What is your name?")
result, err := q.Run()
  • Confirmation Prompt: Asks users a yes/no question.
c := prompt.NewConfirmationPrompt("Are you sure?")
result, err := c.Run()

FAQs

Package last updated on 19 Oct 2024

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc