Skip to content

Commit

Permalink
doc: polish
Browse files Browse the repository at this point in the history
Signed-off-by: Tony Gorez <gorez.tony@gmail.com>
  • Loading branch information
tony-go committed Mar 3, 2024
1 parent e0c23c5 commit 04f8cba
Showing 1 changed file with 30 additions and 3 deletions.
33 changes: 30 additions & 3 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,15 @@

## 📖 Usage (API)

### std::optional<std::string> Prompt::ask_for_input(std::string question)
### Prompt::ask_for_input

Prompts the user for input with the provided question.

| Parameter | Type | Description |
|------------|----------------|-------------------------------|
| `question` | `std::string` | The question to present to the user. |

**Returns**: `std::optional<std::string>` containing the user's input if provided, or an empty optional if the user provides no input.

```cpp
#include <qupp/prompt/prompt.h>
Expand All @@ -27,7 +35,17 @@ int main() {
}
```

### std::optional<std::string> Prompt::select(std::string question, std::vector<std::string> options)
### Prompt::select

Presents a list of options to the user and allows them to select one.

| Parameter | Type | Description |
|------------|-----------------------------|------------------------------------|
| `question` | `std::string` | The question to present to the user. |
| `options` | `std::vector<std::string>` | A list of options for the user to select from. |

**Returns:** `std::optional<std::string>` containing the selected option or empty if no selection was made.


```cpp
#include <qupp/prompt/prompt.h>
Expand All @@ -48,7 +66,16 @@ int main() {
}
```

### std::optional<std::vector<std::string>> Prompt::select_multiple(std::string question, std::vector<std::string> options)
### Prompt::select_multiple

Presents a list of options to the user and allows them to select multiple.

| Parameter | Type | Description |
|------------|-----------------------------|------------------------------------|
| `question` | `std::string` | The question to present to the user. |
| `options` | `std::vector<std::string>` | A list of options for the user to select from. |

**Returns:** `std::optional<std::vector<std::string>>` containing the selected options or empty if no selections were made.

```cpp
#include <qupp/prompt/prompt.h>
Expand Down

0 comments on commit 04f8cba

Please sign in to comment.