Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
works
  • Loading branch information
malcolmstill committed Jan 26, 2025
1 parent 8468e29 commit 6474785
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 14 deletions.
3 changes: 0 additions & 3 deletions build.zig
Original file line number Diff line number Diff line change
Expand Up @@ -24,9 +24,6 @@ pub fn build(b: *std.Build) void {
exe.root_module.addImport("sqlite", sqlite.module("sqlite"));
exe.root_module.addImport("ansi-term", @"ansi-term".module("ansi-term"));

// links the bundled sqlite3, so leave this out if you link the system one
exe.linkLibrary(sqlite.artifact("sqlite"));

// This declares intent for the executable to be installed into the
// standard location when the user invokes the "install" step (the default
// step when running `zig build`).
Expand Down
10 changes: 4 additions & 6 deletions build.zig.zon
Original file line number Diff line number Diff line change
Expand Up @@ -3,14 +3,12 @@
.version = "0.0.0",
.dependencies = .{
.sqlite = .{
.url = "https://github.com/vrischmann/zig-sqlite/archive/878f8cf92b308dabe2dce9e24bd7849e005f7ab5.tar.gz",
.hash = "1220a3ff3c8e2a41fe0fe73e795e0eee4c3882edceef8ef16b0b250c7895709a9192",
.url = "https://github.com/vrischmann/zig-sqlite/archive/7165a6e4e4b82c8acc058d6a400096010445770c.tar.gz",
.hash = "1220c154890f02ff02d4b1e5e3753f826c045779164774c9e9fb962095947b47bb19",
},
.@"ansi-term" = .{
// ansi-term not yet on zig-0.13.0
// .url = "https://github.com/ziglibs/ansi-term/archive/f9ea80dc9769dfffbb4c56a904149940c79168da.tar.gz",
// .hash = "1220c650d57ceb323d3e74945189aaae7a9c0ac74afd023cba5533fb7d5874b2955c",
.path = "lib/ansi-term",
.url = "git+https://github.com/ziglibs/ansi-term/?ref=HEAD#010f170cbe72786ed52645a9dd6cde27b02b47b4",
.hash = "12203a64b02d46e6c2e268b7da60cb11b2fa83dc580cad77cf330d1438e2280de46f",
},
},
.paths = .{""},
Expand Down
10 changes: 5 additions & 5 deletions src/print.zig
Original file line number Diff line number Diff line change
Expand Up @@ -21,14 +21,14 @@ pub fn help(stdout: anytype) !void {
const version_number = @embedFile(".version");

pub fn version(stdout: anytype) !void {
const bold = .{ .font_style = style.FontStyle.bold };
const bold: ansi.style.Style = .{ .font_style = .{ .bold = true } };
try format.updateStyle(stdout, bold, null);
try stdout.print("clerk {s}\n", .{version_number});
try format.updateStyle(stdout, .{}, bold);
}

pub fn err(stdout: anytype, message: []const u8) !void {
const sty = .{ .foreground = style.Color.Red };
const sty: ansi.style.Style = .{ .foreground = style.Color.Red };
try format.updateStyle(stdout, sty, null);
try stdout.print("{s}", .{message});
try format.updateStyle(stdout, .{}, sty);
Expand Down Expand Up @@ -75,6 +75,6 @@ pub fn noSuchId(stdout: anytype, id: usize) !void {
try stdout.print("]\n", .{});
}

const yellow = .{ .foreground = style.Color.Yellow, .font_style = style.FontStyle.bold };
const red = .{ .foreground = style.Color.Red, .font_style = style.FontStyle.bold };
const green = .{ .foreground = style.Color.Green, .font_style = style.FontStyle.bold };
const yellow: ansi.style.Style = .{ .foreground = style.Color.Yellow, .font_style = .{ .bold = true } };
const red: ansi.style.Style = .{ .foreground = style.Color.Red, .font_style = .{ .bold = true } };
const green: ansi.style.Style = .{ .foreground = style.Color.Green, .font_style = .{ .bold = true } };

0 comments on commit 6474785

Please sign in to comment.