Skip to content

Commit

Permalink
Merge pull request #11 from yassinebenaid/dev
Browse files Browse the repository at this point in the history
Updated doc blocks, readme and deleted unused files
  • Loading branch information
yassinebenaid authored Oct 1, 2023
2 parents 6154372 + dac5378 commit b29d24d
Show file tree
Hide file tree
Showing 3 changed files with 14 additions and 18 deletions.
22 changes: 12 additions & 10 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,13 @@

Build command line prompts with ease, prompts provides several apis to help you create intuitive TUI faster,

![Screenshot from 2023-09-30 19-38-45](https://github.com/yassinebenaid/prompts/assets/101285507/7ef5edb3-b13c-4e64-b03d-74f627165982)
![Screenshot from 2023-09-30 19-38-45](https://github.com/yassinebenaid/prompts/assets/101285507/7ef5edb3-b13c-4e64-b03d-74f627165982)

## Installation

```bash
go get github.com/yassinebenaid/prompts
```

## API

Expand Down Expand Up @@ -73,9 +78,8 @@ fmt.Println("password : " + value)
```

- **Result**:

![image](https://github.com/yassinebenaid/prompts/assets/101285507/825f5688-9d55-4e2d-acf2-c5b308dfc4a5)

![image](https://github.com/yassinebenaid/prompts/assets/101285507/825f5688-9d55-4e2d-acf2-c5b308dfc4a5)

#

Expand All @@ -102,7 +106,6 @@ fmt.Println("answer : ", value)

![image](https://github.com/yassinebenaid/prompts/assets/101285507/8a6c51cb-847d-415a-b11e-96cbf0a2beeb)


#

### Radio Input
Expand All @@ -128,12 +131,11 @@ fmt.Println("gender : ", genders[value])

![image](https://github.com/yassinebenaid/prompts/assets/101285507/52e82922-844c-4c3a-89b7-a9d8800cd5b0)


#

### Select Box

The select box api can be used to prompt the user to choose between several options , it returns a slice of selected indexes,
The select box api can be used to prompt the user to choose between several options , it returns a slice of selected indexes,

- **Usage**:

Expand All @@ -149,14 +151,17 @@ if err != nil {

fmt.Println("gender : ", value)
```

- **Result**:

![image](https://github.com/yassinebenaid/prompts/assets/101285507/192424db-c9fe-480d-9f9b-4f8d6cdff56b)

#

### Alerts

these are helper apis you can use for better alerts and messages.

```go
prompts.Info("Info alert")
prompts.Error("Error alert")
Expand All @@ -165,12 +170,9 @@ prompts.Success("Success alert")
```

- **Result**:

![Screenshot from 2023-09-29 18-18-21](https://github.com/yassinebenaid/prompts/assets/101285507/d380f45b-4db4-4a9d-b4a2-8edf5f518579)


![Screenshot from 2023-09-29 18-18-21](https://github.com/yassinebenaid/prompts/assets/101285507/d380f45b-4db4-4a9d-b4a2-8edf5f518579)


```go
prompts.InfoMessage("Info message")
prompts.ErrorMessage("Error message")
Expand Down
File renamed without changes.
10 changes: 2 additions & 8 deletions utils.go
Original file line number Diff line number Diff line change
@@ -1,11 +1,5 @@
// prompts helps you build cli applications by abstracting all terminal intractions in an easy to use
// apis and let you focus on the core of your application where it takes care of accepting the inputs and returning the output
//
// in other words , prompts is the connection between your application and the terminal
//
// it provides several components to format the output and give it custom styles
// , a router to structure the commands tree, components for accepting user input and a logger
// that you can use to log errors in a nice styles
// prompts offers several configurable, ituitive and intractive CLI components
// including inputs, selectbox, radio box and alerts formatter, just to name a few
package prompts

import (
Expand Down

0 comments on commit b29d24d

Please sign in to comment.