| ... | @@ -1,23 +1,27 @@ | ... | @@ -1,23 +1,27 @@ |
| 1 | # zig-inquirer | 1 | # zig-inquirer |
| 2 | | 2 | |
| | 3 |  |
| | 4 | [](https://github.com/nektro/zig-inquirer/blob/master/LICENSE) |
| | 5 | [](https://github.com/sponsors/nektro) |
| | 6 | [](https://ziglang.org/) |
| | 7 | [](https://github.com/nektro/zigmod) |
| | 8 | |
| 3 | A collection of utilities for prompting information from the user on the CLI | 9 | A collection of utilities for prompting information from the user on the CLI |
| 4 | | 10 | |
| 5 | Adapted from https://github.com/SBoudrias/Inquirer.js | 11 | Adapted from https://github.com/SBoudrias/Inquirer.js |
| 6 | | 12 | |
| 7 | ## Add me | | |
| 8 | ``` | | |
| 9 | zigmod aq add 1/nektro/inquirer | | |
| 10 | ``` | | |
| 11 | | | |
| 12 | ## Run example | 13 | ## Run example |
| | 14 | |
| 13 | ``` | 15 | ``` |
| 14 | zig build run | 16 | zig build run |
| 15 | ``` | 17 | ``` |
| 16 | | 18 | |
| 17 | ## Screenshots | 19 | ## Screenshots |
| | 20 | |
| 18 |  | 21 |  |
| 19 | | 22 | |
| 20 | ## Usage | 23 | ## Usage |
| | 24 | |
| 21 | - `pub fn answer(writer, reader, comptime prompt: []const u8, value: []const u8) []const u8` | 25 | - `pub fn answer(writer, reader, comptime prompt: []const u8, value: []const u8) []const u8` |
| 22 | - Prints just the done string. | 26 | - Prints just the done string. |
| 23 | - `pub fn forEnum(writer, reader, comptime prompt: []const u8, alloc: *std.mem.Allocator, comptime options: enum, default: ?options) !options` | 27 | - `pub fn forEnum(writer, reader, comptime prompt: []const u8, alloc: *std.mem.Allocator, comptime options: enum, default: ?options) !options` |
| ... | @@ -28,12 +32,10 @@ zig build run | ... | @@ -28,12 +32,10 @@ zig build run |
| 28 | - Calls `forEnum` with `y/n` | 32 | - Calls `forEnum` with `y/n` |
| 29 | | 33 | |
| 30 | ## TODO | 34 | ## TODO |
| | 35 | |
| 31 | - number (current implementation causes compiler crash) | 36 | - number (current implementation causes compiler crash) |
| 32 | - list with strings | 37 | - list with strings |
| 33 | - string password | 38 | - string password |
| 34 | - long list with autocomplete | 39 | - long list with autocomplete |
| 35 | - date | 40 | - date |
| 36 | - time | 41 | - time |
| 37 | | | |
| 38 | ## License | | |
| 39 | MIT | | |