Skip to content

Commit 5a9bd21

Browse files
authored
Merge pull request #1 from truemedian/master
run zig format
2 parents 01652e4 + a36044b commit 5a9bd21

File tree

2 files changed

+7
-7
lines changed

2 files changed

+7
-7
lines changed

src/ansi.zig

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,7 @@ fn escape(comptime literal: []const u8) []const u8 {
22
return "\x1b[" ++ literal;
33
}
44

5+
// zig fmt: off
56
pub const Black = "30";
67
pub const Red = "31";
78
pub const Green = "32";
@@ -19,6 +20,7 @@ pub const LightBlue = "94";
1920
pub const LightMagenta = "95";
2021
pub const LightCyan = "96";
2122
pub const White = "97";
23+
// zig fmt: on
2224

2325
pub fn Reset() []const u8 {
2426
return escape("0m");

src/main.zig

Lines changed: 5 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,7 @@ pub fn askDirPath(allocator: *std.mem.Allocator, prompt: []const u8, max_size: u
2626
allocator.free(path);
2727
continue;
2828
}
29-
29+
3030
var dir = std.fs.cwd().openDir(path, std.fs.Dir.OpenDirOptions{}) catch {
3131
_ = try out.write(ansi.Foreground(ansi.Red) ++ "Error: Invalid directory, please try again.\n\n" ++ ansi.Reset());
3232
allocator.free(path);
@@ -57,7 +57,7 @@ pub fn askBool(prompt: []const u8) !bool {
5757
switch (buffer[0]) {
5858
'y' => return true,
5959
'n' => return false,
60-
else => continue
60+
else => continue,
6161
}
6262
}
6363
}
@@ -90,11 +90,11 @@ pub fn askSelectOne(prompt: []const u8, comptime options: type) !options {
9090
continue;
9191
}) orelse return error.EndOfStream;
9292
result = if (std.mem.endsWith(u8, result, "\r")) result[0..(result.len - 1)] else result;
93-
93+
9494
inline for (@typeInfo(options).Enum.fields) |option|
9595
if (std.mem.eql(u8, option.name, result))
9696
return @intToEnum(options, option.value);
97-
// return option.value;
97+
// return option.value;
9898

9999
_ = try out.write(ansi.Foreground(ansi.Red) ++ "Error: Invalid option, please try again.\n" ++ ansi.Reset());
100100
}
@@ -114,9 +114,7 @@ test "basic input functionality" {
114114

115115
// defer testing.allocator.free(select);
116116

117-
if (select == .VSCode) {
118-
119-
}
117+
if (select == .VSCode) {}
120118

121119
std.debug.warn("\n\n", .{});
122120
}

0 commit comments

Comments
 (0)