| author | |
| committer | |
| log | 04fa58bb653abc5e42dd03dbf669b099ba6eff7f |
| tree | 823576a040f3552a839bbfa0a88c25743345eddd |
| parent | 3270255ea4c6d919853527e6a73baecfdee6867d |
| signature |
2 files changed, 2 insertions(+), 2 deletions(-)
README.md+1-1| ... | @@ -3,7 +3,7 @@ | ... | @@ -3,7 +3,7 @@ |
| 3 |  | 3 |  |
| 4 | [](https://github.com/nektro/zig-inquirer/blob/master/LICENSE) | 4 | [](https://github.com/nektro/zig-inquirer/blob/master/LICENSE) |
| 5 | [](https://github.com/sponsors/nektro) | 5 | [](https://github.com/sponsors/nektro) |
| 6 | [](https://ziglang.org/) | 6 | [](https://ziglang.org/) |
| 7 | [](https://github.com/nektro/zigmod) | 7 | [](https://github.com/nektro/zigmod) |
| 8 | 8 | ||
| 9 | 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 |
src/lib.zig+1-1| ... | @@ -19,7 +19,7 @@ fn doprompt(out: anytype, in: anytype, alloc: std.mem.Allocator, default: ?[]con | ... | @@ -19,7 +19,7 @@ fn doprompt(out: anytype, in: anytype, alloc: std.mem.Allocator, default: ?[]con |
| 19 | while (true) : (n += 1) { | 19 | while (true) : (n += 1) { |
| 20 | try out.print(comptime ansi.color.Faint("> "), .{}); | 20 | try out.print(comptime ansi.color.Faint("> "), .{}); |
| 21 | var input: []const u8 = try in.readUntilDelimiterAlloc(alloc, '\n', 1024); | 21 | var input: []const u8 = try in.readUntilDelimiterAlloc(alloc, '\n', 1024); |
| 22 | input = std.mem.trimRight(u8, input, "\r\n"); | 22 | input = std.mem.trimEnd(u8, input, "\r\n"); |
| 23 | 23 | ||
| 24 | if (input.len == 0) if (default) |d| { | 24 | if (input.len == 0) if (default) |d| { |
| 25 | value = d; | 25 | value = d; |