deiwin / Interact
Licence: mit
A Golang utility belt for interacting with the user over a CLI
Stars: ✭ 129
Programming Languages
go
31211 projects - #10 most used programming language
Labels
Projects that are alternatives of or similar to Interact
Speedtest Go
CLI and Go API to Test Internet Speed using speedtest.net
Stars: ✭ 128 (-0.78%)
Mutual labels: cli
Create Elm App
🍃 Create Elm apps with zero configuration
Stars: ✭ 1,650 (+1179.07%)
Mutual labels: cli
Node Appletv
A node module for interacting with an Apple TV (4th-generation or later) over the Media Remote Protocol.
Stars: ✭ 129 (+0%)
Mutual labels: cli
Ckube
A cli to simplify working with kubectl for some common workflows
Stars: ✭ 127 (-1.55%)
Mutual labels: cli
Gitless
A simple version control system built on top of Git
Stars: ✭ 1,660 (+1186.82%)
Mutual labels: cli
Mhy
🧩 A zero-config, out-of-the-box, multi-purpose toolbox and development environment
Stars: ✭ 128 (-0.78%)
Mutual labels: cli
Tsed
📐 Ts.ED is a Node.js and TypeScript framework on top of Express to write your application with TypeScript (or ES6). It provides a lot of decorators and guideline to make your code more readable and less error-prone.
Stars: ✭ 1,941 (+1404.65%)
Mutual labels: cli
Awesome Wp Cli
A curated list of packages and resources for WP-CLI, the command-line interface for WordPress.
Stars: ✭ 129 (+0%)
Mutual labels: cli
Typex
[TOOL, CLI] - Filter and examine Go type structures, interfaces and their transitive dependencies and relationships. Export structural types as TypeScript value object or bare type representations.
Stars: ✭ 128 (-0.78%)
Mutual labels: cli
Check It Out
A command line interface for Git Checkout. See branches available for checkout.
Stars: ✭ 127 (-1.55%)
Mutual labels: cli
Interact
A Golang utility belt for interacting with the user over a CLI
Example interaction
Code like this:
actor := interact.NewActor(os.Stdin, os.Stdout)
message := "Please enter something that's not empty"
notEmpty, err := actor.Prompt(message, checkNotEmpty)
if err != nil {
log.Fatal(err)
}
message = "Please enter a positive number"
n1, err := actor.PromptAndRetry(message, checkNotEmpty, checkIsAPositiveNumber)
if err != nil {
log.Fatal(err)
}
message = "Please enter another positive number"
n2, err := actor.PromptOptionalAndRetry(message, "7", checkNotEmpty, checkIsAPositiveNumber)
if err != nil {
log.Fatal(err)
}
fmt.Printf("Thanks! (%s, %s, %s)\n", notEmpty, n1, n2)
Can create an interaction like this:
For a more comprehensive example see the example test.
Note that the project description data, including the texts, logos, images, and/or trademarks,
for each open source project belongs to its rightful owner.
If you wish to add or remove any projects, please contact us at [email protected].